summaryrefslogtreecommitdiff
path: root/dix
AgeCommit message (Collapse)AuthorFilesLines
2016-04-29dix: Squash some new gcc6 warningsAdam Jackson1-2/+1
-Wlogical-op now tells us: devices.c:1685:23: warning: logical ‘and’ of equal expressions Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-22dix/ptraccel: Remove float literalsSimon Thum1-19/+19
This was fine back when valuators were integer. Device properties are float (not double), so some instances remain. 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>
2016-04-22dix/ptraccel: Fix memory leak in InitPredictableAccelerationSchemeSimon Thum1-2/+8
This was quite unlikely except in situations where a proper startup would have been impossible anyway, but since automated checks don't grade likelyhood just fix it. Detected by Jeremy Huddleston's clang checks. 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>
2016-04-18dix: Add RootWindowFinalizeCallbackAdam Jackson1-0/+3
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-02-29dix: 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>
2016-02-22dix: 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>
2015-12-07prime: 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>
2015-12-01dix: Move InitFonts up above screen initializationKeith Packard2-2/+3
Font initialization was split into two stages, the first was to set up font privates with a call to ResetFontPrivateIndex, then much later the call to InitFonts to set up all of the FPEs. Doing the full font initialization before initializing the video drivers means that we can move the call to ResetFontPrivateIndex inside InitFonts. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01Remove non-smart scheduler. Don't require setitimer.Keith Packard1-7/+10
This allows the server to call GetTimeInMillis() after each request is processed to avoid needing setitimer. -dumbSched now turns off the setitimer. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-11-30dix: Remove redundant ChangeWindowPropertyAdam Jackson1-8/+0
Use dixChangeWindowProperty(serverClient, ...) instead. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2015-11-24Input: Add focus-in event sourceDaniel Stone1-0/+5
Add a new event source type for keypress events synthesised from focus notifications (e.g. KeymapNotify from the parent server, when running nested). This is used to keep the keys-down array in sync with the host server's, without sending actual keypress events to clients. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-11-24Input: Add DeviceEventSource enumDaniel Stone2-12/+16
Add a flag to DeviceEvents, giving the source of the event. Currently this only supports a 'normal' flag, but will be used later to add a 'focus-in' flag, noting events synthesised from key/button arrays on focus-in notifications. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-11-10Also 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>
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>