summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-06-23dri2: Use the PrimeScreen when creating/reusing buffersHEADmasterChris Wilson1-10/+6
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 <chris@chris-wilson.co.uk> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-23glamor: Fix GLES2 non-VBO temporary memory allocation.Eric Anholt1-1/+1
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 <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-23Merge remote-tracking branch 'whot/for-keith'Keith Packard1-20/+60
2014-06-23present: fix bad logic in cancelling scheduled operations.Axel Davy1-1/+1
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 <axel.davy@ens.fr> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-23arch: Fix image and bitmap byte order for ppc64leDinar Valeev1-2/+7
So far PPC was big endian for sure. For ppc64le this is no longer true. Signed-off-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-23Merge remote-tracking branch 'anholt/glamor-fixes'Keith Packard5-3/+8
2014-06-23present: restore screen pixmap when aborting a flipFrank Binns1-3/+21
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 <keithp@keithp.com> Signed-off-by: Frank Binns <frank.binns@imgtec.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-23dix: fix up coordinate scaling when external monitors are presentPeter Hutterer1-20/+60
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 <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17present: Remove executing vblank from window list. Bug# 79709.Keith Packard1-0/+1
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 <keithp@keithp.com>
2014-06-12glamor: Don't leak a prepare_access_gc() in putimage fallbacks.Eric Anholt1-2/+1
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 <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-06-12glamor: Choose max fbo size by texture + viewport sizeMarkus Wick1-1/+4
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 <markus@selfnet.de> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-12glamor: Fix no-mipmap allocationsMarkus Wick3-0/+3
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 <markus@selfnet.de> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-06-06config: show default path in help for --with-xkb-bin-directoryAlan Coopersmith1-1/+1
Now shows: --with-xkb-bin-directory=DIR Directory containing xkbcomp program (default: ${bindir}) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-06mi: Build fix: mieqProcessDeviceEvent returns voidJeremy Huddleston Sequoia1-1/+1
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 <jeremyhu@apple.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-04Update to version 1.15.99.903Keith Packard1-3/+3
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-04mi: don't process events from disabled devices (#77884)Peter Hutterer2-1/+17
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 <http://bugs.freedesktop.org/show_bug.cgi?id=77884> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Tested-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-04present: Queue flips for later executionKeith Packard2-38/+89
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 <keithp@keithp.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Tested-by: Frank Binns <frank.binns@imgtec.com>
2014-06-04xfixes: disable cursor on X server resetFrank Binns1-0/+2
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 <frank.binns@imgtec.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-04dix: fix pixmap leak on server resetBrendan King1-4/+3
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 <frank.binns@imgtec.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-04dix: reference the cursor just once in InitializeSprite()Brendan King1-1/+1
The new current cursor was being referenced twice, resulting in a memory leak when the current server generation ended. Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-04fb: fix screen pixmap leak on server resetBrendan King1-1/+1
Call FreePixmap() instead of free() to destroy the screen pixmap in fbCloseScreen(). Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-02xfree86: Report Present as a built-in moduleChris Wilson1-0/+3
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 <chris@chris-wilson.co.uk> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-02xfree86: Report DRI3 as a built-in moduleChris Wilson1-0/+3
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 <chris@chris-wilson.co.uk> Cc: Mark Kettenis <mark.kettenis@xs4all.nl> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-02Merge remote-tracking branch 'jturney/master'Keith Packard2-12/+4
2014-06-02xtensa: add support for xtensa architectureMax Filippov3-2/+20
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-02Merge remote-tracking branch 'jeremyhu/master'Keith Packard3-21/+15
2014-06-02xfree86: Add "modesetting" to list of fallback driversSøren Sandmann1-1/+1
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 <ssp@redhat.com> Acked-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-02Merge remote-tracking branch 'whot/for-keith'Keith Packard5-52/+40
2014-06-02Fix overflow checking extension versionsRobert Ancell1-7/+11
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 <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-02configure: Require sufficiently new wayland-client for xwayland ddxAdam Jackson1-1/+1
The explicit release requests were added in 1.3.0, don't try to build against older. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-02configure: Restore DEFAULT_LOGDIR to xwin-config.h, it is usedJon TURNEY1-0/+3
Commit f37a46913489397d8628ffe578c8d4ed50b6ca72 removed this from xwin-config.h.in for some reason, but it is used. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-06-02hw/xwin: Update for __glXLastContext -> lastGLContextJon TURNEY1-12/+1
Update for __glXLastContext -> lastGLContext. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-05-31XQuartz: Update logic to account for title bar on every display in MavericksJeremy Huddleston Sequoia1-3/+13
<rdar://problem/14205847> http://xquartz.macosforge.org/trac/ticket/832 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-31XQuartz: Dead code removal (ENABLE_DEBUG_LOG)Jeremy Huddleston Sequoia1-16/+0
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-31XQuartz: Bump to 2.7.7Jeremy Huddleston Sequoia1-2/+2
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-24man: drop specific mention of DontZap in -retro (#71113)Peter Hutterer1-3/+2
DontZap off is the default anyway, don't mention it specifically to avoid confusion X.Org Bug 71113 <http://bugs.freedesktop.org/show_bug.cgi?id=71113> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-05-24xfree86: fix wrong DontZap documentation (#71113)Peter Hutterer1-1/+1
X.Org Bug 71113 <http://bugs.freedesktop.org/show_bug.cgi?id=71113> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-05-23Fix overflow checking extension versionsRobert Ancell1-7/+11
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 <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-05-22glx: Require at least one True/DirectColor visualAdam Jackson1-0/+21
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 <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-05-23Xi: block SIGIOs while copying device classes aroundSteven McDonald1-0/+4
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 <https://bugs.debian.org/744303> 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>
2014-05-23os: automatically switch to sigsafe logging when neededPeter Hutterer1-32/+33
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 <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-05-22shadowfb: Fix initializationAdam Jackson1-11/+15
This has to run at initial CreateWindow time, at CreateScreenResources the root window doesn't actually exist yet. Tested-by: Michael Thayer <michael.thayer@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Michael Thayer <michael.thayer@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-05-22glxproxy: Fix memory leak on error path in CreateGLXPixmap (#50281) (v2)Adam Jackson1-0/+2
v2: Fix another path spotted by keithp Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-05-22dmx: Fix memory leak in dmxBELoadFont (#50281)Adam Jackson1-1/+1
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-05-22dri2: Fix detection of wrong prime_id in GetScreenPrime.Michal Srb1-4/+2
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 <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-05-22ARC: Add support for ARC architectureAlexey Brodkin3-3/+17
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 <abrodkin@synopsys.com> Acked-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Egbert Eich <eich@freedesktop.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-05-15config: revert quirk for the Evoluent Vertical MousePeter Hutterer1-16/+0
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 <peter.hutterer@who-t.net>
2014-05-12rrcrtc: brackets are hard, lets go shopping.Dave Airlie1-3/+4
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 <airlied@redhat.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2014-05-12glamor: Don't forget to check whether we can fall back in polysegment.Eric Anholt1-3/+8
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 <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-05-12xfree86: fix warnings after MatchSeat patchLaércio de Sousa1-12/+12
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 <keithp@keithp.com>