summaryrefslogtreecommitdiff
path: root/dix
AgeCommit message (Collapse)AuthorFilesLines
2016-03-23Merge tag 'xorg-server-1.18.2' into cygwin-release-1.18Jon Turney2-11/+43
xorg-server-1.18.2
2016-03-11dix: Add ClientSignalAll()Chris Wilson1-0/+22
This is a variant of ClientSignal() that signals all clients with an optional matching sleeping client, function and closure. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (cherry picked from commit bc3634010c096dffd1935c0c6cf8ba37534ae3d8)
2016-03-11dix: Add hybrid full-size/empty-clip mode to SetRootClipDaniel Stone1-11/+21
216bdbc735 removed the SetRootClip call in the XWayland output-hotplug handler when running rootless (e.g. as a part of Weston/Mutter), since the root window has no storage, so generating exposures will result in writes to invalid memory. Unfortunately, preventing the segfault also breaks sprite confinement. SetRootClip updates winSize and borderSize for the root window, which when combined with RRScreenSizeChanged calling ScreenRestructured, generates a new sprite-confinment area to update it to the whole screen. Removing this call results in the window geometry being reported correctly, but winSize/borderSize never changing from their values at startup, i.e. out of sync with the root window geometry / screen information in the connection info / XRandR. This patch introduces a hybrid mode, where we update winSize and borderSize for the root window, enabling sprite confinement to work correctly, but keep the clip emptied so exposures are never generated. Signed-off-by: Daniel Stone <daniels@collabora.com> Tested-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com> (cherry picked from commit e957a2e5dd288f515f3e93724823542c20333f6a)
2016-02-18Merge tag 'xorg-server-1.18.1' into cygwin-release-1.18Jon Turney2-0/+147
xorg-server-1.18.1
2015-12-09prime: Damage full destination rectangle when we start dirty trackingMichel Dänzer1-0/+21
This makes sure that the destination pixmap contents will be fully initialized. Without this, a PRIME output starts out with garbage. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 530d3e5ca0a02039b04ec6a677bbb4e05b78e5f4)
2015-12-09Also dump passive grabs on XF86LogGrabInfoMichael Stapelberg1-0/+126
Signed-off-by: Michael Stapelberg <stapelberg@google.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit a6cddb8c04ddc3c48aae3f3611ad9f336fecb09d)
2015-11-10Disable smart scheduler on CygwinJon Turney1-1/+1
The smart scheduler firing SIGALRM every 20ms causes serious problems on Cygwin. Symptoms include sporadic 'accept() failed' messages in the log and deadlocks in multiwindow mode. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2015-10-19fonts: Continue when font calls return Suspended more than onceKeith Packard1-21/+0
Patch 3ab6cd31cbdf8095b2948034fce5fb645422d8da fixed Xinerama interactions with font servers by not putting clients to sleep multiple times. However, it introduced additional changes dealing with libXfont routine returning Suspended more than once for the same request. This additional change was to abandon processing of the current request and free the closure data by jumping to 'xinerama_sleep' in each of the functions. Font library functions shouldn't return Suspended more than once, except for ListFontsWithInfo, which produces multiple replies, and thus ends up returning Suspended many times during processing. With the jump to xinerama_sleep occurring after the first reply was processed, the closure for the request was freed and future calls into the ListFontsWithInfo callback resulted in dereferencing freed memory. This patch removes the added branches, reverting the code to its previous behaviour, which permitted multiple Suspended returns and simply waited for the client to be signaled again so that the callback could continue processing the request. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2015-10-19dix: Silence -Wunused-variable warning by moving window.c off of legacy ↵Jeremy Huddleston1-5/+4
region defines window.c:223:15: warning: unused variable 'pScreen' [-Wunused-variable,Unused Entity Issue] ScreenPtr pScreen = pWin->drawable.pScreen; ^ Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-09-25protocol.txt: Add MIT-SHM 1.2 requestsAlan Coopersmith1-0/+2
Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-09-25protocol.txt: Add DRI3 1.0 requestsAlan Coopersmith1-0/+6
Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-09-25protocol.txt: Add Present 1.0 requestsAlan Coopersmith1-0/+5
Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-09-25protocol.txt: Add RANDR 1.5 requestsAlan Coopersmith1-0/+3
Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-09-25protocol.txt: Remove extensions that died before Xorg was bornAlan Coopersmith1-182/+0
Adobe-DPS-Extension, DEC-XTRAP, X3D-PEX, XIE Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-09-23dix: put warning in for scroll increments of 0Peter Hutterer1-0/+4
If the increment is 0 but this is a scroll axis, it's definitely a bug. Nonetheless, it has happened, so put a warning in and a return statement that we avoid the infinite loop and hopefully be able to reproduce later. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2015-09-22dix: remove dead extensions to protocol.txtTiago Vignatti1-59/+0
lbx and mbe. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2015-09-22Add new GLX events errors and requests to protocol.txtRobert Hooker1-0/+38
Based off of glproto 1.4.11. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
2015-09-22Add DRI2 2.2/2.3 events and requests to protocol.txtRobert Hooker1-0/+7
Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
2015-09-21privates: Clear screen-specific keys during CloseScreenAaron Plattner2-0/+10
The modesetting driver corrupts memory when used after a server regeneration because not enough memory is allocated for its pixmap privates. This happens because its call to dixRegisterScreenSpecificPrivateKey() does nothing because key->initialized is still TRUE from the first server generation. However, the key is not in the screen's linked list of screen-specific privates because that's freed and reallocated during the server generation loop in dix_main(). Fix this by clearing key->initialized before CloseScreen and add a call to dixFreeScreenSpecificPrivates() for GPU screens. v2: Just set key->initialized to FALSE and move dixFreeScreenSpecificPrivates() calls to after CloseScreen. v3: Move dixFreeScreenSpecificPrivates() calls back to just before CloseScreen. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2015-08-28debug output format fix in TouchEventHistoryPush()Jon TURNEY1-1/+1
xserver/build.x86_64/../dix/touch.c:468:16: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Werror=format=] %zu is C99, but is already used in a few places. Perhaps doc/c-extensions needs to mention it. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-24configurable maximum number of clientsOlivier Fourdan4-22/+45
Make the maximum number of clients user configurable, either from the command line or from xorg.conf This patch works by using the MAXCLIENTS (raised to 512) as the maximum allowed number of clients, but allowing the actual limit to be set by the user to a lower value (keeping the default of 256). There is a limit size of 29 bits to be used to store both the client ID and the X resources ID, so by reducing the number of clients allowed to connect to the X server, the user can increase the number of X resources per client or vice-versa. Parts of this patch are based on a similar patch from Adam Jackson <ajax@redhat.com> This now requires at least xproto 7.0.28 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-07-08atom: make FreeAtom staticAdam Jackson1-3/+1
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-07-08atom: Bump initial table sizeAdam Jackson1-1/+1
We're always creating ~230 atoms at startup, might as well tune it so we don't hit the realloc path before Dispatch. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-07-08dix: Restore PaintWindow screen hookAdam Jackson1-2/+2
Removes the last cpp conditional on ROOTLESS from dix code. Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-07-08dix: unifdef pWin->rootlessUnhittableAdam Jackson1-4/+1
No reason to vary the dix ABI over this. Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-07-08dix: Unexport various implementation detailsAdam Jackson6-176/+180
Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-07-08prime: add rotation support for offloaded outputs (v2)Dave Airlie1-44/+136
One of the lacking features with output offloading was that screen rotation didn't work at all. This patch makes 0/90/180/270 rotation work with USB output and GPU outputs. When it allocates the shared pixmap it allocates it rotated, and any updates to the shared pixmap are done using a composite path that does the rotation. The slave GPU then doesn't need to know about the rotation and just displays the pixmap. v2: rewrite the sync dirty helper to use the dst pixmap, and avoid any strange hobbits and rotations. This breaks ABI in two places. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-06-30cursor: drop ARGB_CURSORDave Airlie1-8/+0
I doubt anyone builds with this turned off or has done for a long time. It helps my eyes bleed slightly less when reading the code, I've left the define in place as some drivers use it. Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-05-20dix: hook up the unaccelerated valuator masksPeter Hutterer1-7/+20
If present, access the unaccelerated valuator mask values for DGA and XI2 raw events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-20dix: Add unaccelerated valuators to the ValuatorMaskPeter Hutterer1-3/+75
Allows a mask to carry both accelerated and unaccelerated motion at the same time. This is required for xf86-input-libinput where the pointer acceleration happens in libinput already, but parts of the server, specifically raw events and DGA rely on device-specific unaccelerated data. To ease integration add this as a second set to the ValuatorMask rather than extending all APIs to carry a second, possibly NULL set of valuators. Note that a valuator mask should only be used in either accel/unaccel or standard mode at any time. Switching requires either a valuator_mask_zero() call or unsetting all valuators one-by-one. Trying to mix the two will produce a warning. The server has a shortcut for changing a mask with the valuator_mask_drop_unaccelerated() call. This saves us from having to loop through all valuators on every event, we can just drop the bits we know we don't want. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-20dix: fix indentationPeter Hutterer1-2/+2
from 9ff89a2e469ab0ac5af57d0fc115127feb1c0d99 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-11dix: Do not allow device transform to be set on valuatorless devicesJason Gerecke1-0/+3
If a device does not have any valuators, it makes no sense to set the device transformation. Return a BadMatch error to let the caller know that they're trying something stupid. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-11dix/events: Set currentTime to the given time stamp in NoticeTimeRui Matos1-0/+1
The refactoring in commit efc1035ca958f2c9d266338a308518a0834b1773 removed the actual update of currentTime. Signed-off-by: Rui Matos <tiagomatos@gmail.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-04-21Convert dix/* to new *allocarray functionsAlan Coopersmith13-76/+71
v2: remove now useless parentheses Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21Let calloc handle multiplicationAlan Coopersmith2-6/+4
It's going to multiply anyway, so if we have non-constant values, might as well let it do the multiplication instead of adding another multiply, and good versions of calloc will check for & avoid overflow in the process. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-13Drop valuator mask argument from GetKeyboardEventsPeter Hutterer2-36/+6
Nothing was using it and if anyone had they would've gotten a warning and noticed that it doesn't actually work. Drop this, it has been unused for years. Input ABI 22 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2015-02-10Get rid of const warnings in XSERVER_INPUT_EVENT dtrace probe callsAlan Coopersmith5-22/+8
Use typedefs to work around dtrace dropping const qualifiers from probe arguments when generating Xserver-dtrace.h. Add new probes.h header to avoid having to replicate these typedefs in every file with dtrace probes. Gets rid of these warnings from gcc 4.8: getevents.c:1096:9: warning: passing argument 6 of '__dtrace_Xserver___input__event' discards 'const' qualifier from pointer target type [enabled by default] getevents.c:1096:9: warning: passing argument 7 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] getevents.c:1651:9: warning: passing argument 6 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] getevents.c:1651:9: warning: passing argument 7 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] getevents.c:1791:9: warning: passing argument 6 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] getevents.c:1791:9: warning: passing argument 7 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] getevents.c:1921:9: warning: passing argument 6 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] getevents.c:1921:9: warning: passing argument 7 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-05dix: offset touch root coordinates by ScreenRec origins (#86655)Peter Hutterer1-3/+3
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 <http://bugs.freedesktop.org/show_bug.cgi?id=86655> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-03dix: Allow zero-height PutImage requestsKeith Packard1-1/+1
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 <keithp@keithp.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-12-08dix: integer overflow in RegionSizeof() [CVE-2014-8092 3/4]Alan Coopersmith1-7/+13
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 <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2014-12-08dix: integer overflow in ProcPutImage() [CVE-2014-8092 1/4]Alan Coopersmith1-0/+3
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 <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12fix an annotation mistakeJohn Hunter1-1/+1
Signed-off-by: John Hunter <zhaojunwang@pku.edu.cn> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12Drop trailing whitespacesPeter Hutterer21-136/+136
sed -i "s/[ ]\+$//g" **/*.(c|h) happy reviewing... git diff -w is an empty diff. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12dix: silence compiler warning comparing CARD32 to -1Peter Hutterer1-1/+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 <peter.hutterer@who-t.net> Reviewed-by: Michel Dänzer <michel@daenzer.net>
2014-11-12dix: silence compiler warningPeter Hutterer1-0/+2
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 <peter.hutterer@who-t.net>
2014-10-28dix: Untwist transformAbsolute logic, eliminate uninitialized value warningsKeith Packard1-11/+11
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 <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-10-27dix: Always store GC client clip as a region (v2)Adam Jackson1-2/+1
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 <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09Merge remote-tracking branch 'ajax/dead-code'Keith Packard1-57/+0
2014-10-09misc: Fold together some redundant conditionalsAdam Jackson1-20/+18
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09dix: Remove an obfuscatory macroAdam Jackson1-4/+1
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>