summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-08-04Make swapl and swaps macros readablebswap-cleanupMatt Turner1-17/+21
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-08-04Use lswapl() in cpswapl macroMatt Turner1-10/+13
Small reduction in text size: text data bss dec hex filename 1866284 52136 78040 1996460 1e76ac ./hw/xfree86/Xorg 1863788 52136 78040 1993964 1e6cec ./hw/xfree86/Xorg and the number of bswap instructions increases from 5 to 131. lswaps is not used in cpswaps because it actually increases the code size. Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-08-04Add type checking to swap macrosMatt Turner4-14/+22
In a few cases, char* are passed to the swap macros, so cast them. Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-08-04Use correct swap{l,s} (or none at all for CARD8)Matt Turner8-20/+8
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. Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-08-04Use internal temp variable for swap macrosMatt Turner115-4140/+3164
Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-07-29randr: Compare all the bytes in RRPostPendingPropertiesAaron Plattner1-1/+1
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>
2011-07-29Merge remote-tracking branch 'whot/for-keith'Keith Packard21-54/+95
2011-07-27Terminate the log with one last message.Peter Hutterer16-38/+47
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>
2011-07-27configure: set default xkb rules to evdev on LinuxJulien Cristau1-5/+1
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>
2011-07-27Initialize the fd to -1 for xorg.conf input devices.Peter Hutterer1-0/+3
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>
2011-07-27xfree86: NULL option values are technically valid, don't strdup themPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-07-27xfree86: duplicate xorg.conf device information before xf86NewInputDevicePeter Hutterer1-5/+27
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>
2011-07-27xfree86: Remove devices that failed to enable on startupPeter Hutterer1-0/+1
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>
2011-07-27config: don't fail if a device vanished by the time we managed to look at itLennart Poettering1-0/+5
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>
2011-07-27config: limit the kernel subsystems we look for devices inLennart Poettering1-0/+7
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>
2011-07-27config: process udev "changed" and "add" events in the same code pathsLennart Poettering1-5/+3
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>
2011-07-26Remove hw/xwin/xlaunchJon TURNEY23-3557/+1
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-07-19XQuartz: Localization updatesJeremy Huddleston90-32473/+42771
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-19XQuartz: Add english NIB changes for scroll_in_device_directionJeremy Huddleston3-108/+243
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-19XQuartz: Add GUI controls to toggle scroll_in_device_directionJeremy Huddleston2-2/+18
Also cleaned up the wording for fullscreen_menu. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-19XQuartz: Add a scroll_in_device_direction preferenceJeremy Huddleston3-12/+36
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>
2011-07-19XQuartz: Add diagnostic error checking to xp_destroy_surface.George Staplin1-1/+6
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)
2011-07-19XQuartz: Fix a memory leak with surfaces that a new test found.George Staplin1-11/+45
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)
2011-07-19XQuartz: DRI: Dead code removalJeremy Huddleston1-1/+14
Also add some comments that weren't merged in from server-1.4-apple's 99babae1326485c27eb9253db83afdd6aef9e362 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-18XQuartz: Add some sanity checking and a fallback for the bundle id.Jeremy Huddleston1-0/+5
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>
2011-07-15XQuartz: DarwinEQFini doesn't return BoolJeremy Huddleston2-2/+2
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-15XKB: Work around broken interps from old xkbcompDaniel Stone2-4/+46
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>
2011-07-15Fix non-Composite builds in PrintWindowTreeDaniel Stone1-1/+9
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>
2011-07-13Merge remote-tracking branch 'jturney/master'Keith Packard12-53/+128
2011-07-13XWinrc: replace hard coded section number with __filemansuffix__Gaetan Nadon1-1/+1
Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-07-07XWinrc: replace hard coded section number with __filemansuffix__Gaetan Nadon1-1/+1
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>
2011-07-07glx: Remove a few lingering traces of __GLXscreen.GLXVersionJon TURNEY4-9/+4
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>
2011-07-07hw/xwin: Add -wgl option to XWin manpageJon TURNEY1-0/+4
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>
2011-07-07hw/xwin: Add items to WGL AIGLX todoJon TURNEY1-2/+11
Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07hw/xwin: Report Window XIDs in Window debug messagesJon TURNEY2-13/+6
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>
2011-07-07hw/xwin: Add a flag to track which windows have been drawn to using WGL.Jon TURNEY5-2/+34
Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07hw/xwin/glx: Fix some warnings in generated wrapper codeColin Harrison1-1/+1
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>
2011-07-07hw/xwin/glx: Handle failure to get any fbconfigs more gracefully.Jon TURNEY1-3/+23
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>
2011-07-07hw/xwin/glx: Don't spam log with wglwrap symbol resolution status at startupJon TURNEY1-8/+5
... 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>
2011-07-07hw/xwin/glx: Better handling of SetPixelFormat() failureJon TURNEY1-9/+17
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>
2011-07-07hw/xwin/glx: Improvements to glxWinErrorMessage() reporting in WGL GLX providerJon TURNEY1-5/+8
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>
2011-07-07hw/xwin/glx: Fix fbconfig dumper formatting for 3 digit index numbersJon TURNEY1-1/+15
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>
2011-07-01Merge remote-tracking branch 'whot/for-keith'Keith Packard62-108/+370
2011-07-01input: free the EQ allocated memory on shutdown (#38634)Peter Hutterer15-6/+33
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>
2011-07-01Input: Reset SD remainder when copying co-ords from MDDaniel Stone1-0/+7
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>
2011-07-01input: add POINTER_NORAW to avoid generation of raw events (#30068)Peter Hutterer3-12/+17
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>
2011-07-01Test: Input: Only ever set up to MAX_VALUATORS valuatorsDaniel Stone1-7/+11
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>
2011-07-01Test: Ensure libxservertest gets relinked when necessaryDaniel Stone1-0/+1
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>
2011-07-01KDrive: Remove useless miPointerUpdateSprite callDaniel Stone1-1/+0
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>
2011-07-01DMX: Remove useless miPointerUpdateSprite callDaniel Stone1-3/+0
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>