summaryrefslogtreecommitdiff
path: root/dix
AgeCommit message (Collapse)AuthorFilesLines
2012-09-23dix: Factor out DeliverMapNotifyAdam Jackson1-16/+15
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23dix: Factor out MaybeDeliverMapRequestAdam Jackson1-22/+18
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23dix: Fix some indentationAdam Jackson1-9/+5
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23dix: set the device transformation matrixPeter Hutterer1-0/+3
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 <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-20dix: Extend initial connection handshake for forwarding proxiesAdam Jackson1-7/+12
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 <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-04dix: free default colormap before screen deletionDave Airlie1-0/+4
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 <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-08-27Merge remote-tracking branch 'whot/for-keith'Keith Packard1-1/+17
2012-08-21dix: work around scaling issues during WarpPointer (#53037)Peter Hutterer1-1/+17
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 <http://bugs.freedesktop.org/show_bug.cgi?id=53037> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-08-14Close GPU screens before core screensKeith Packard1-9/+9
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 <keithp@keithp.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-08-06Merge remote-tracking branch 'whot/for-keith'Keith Packard1-0/+2
2012-08-06Merge remote-tracking branch 'airlied/for-keithp'Keith Packard1-0/+4
2012-08-07dix: make sure the mask is set for emulated scroll events (#52508)Peter Hutterer1-0/+2
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 <http://bugs.freedesktop.org/show_bug.cgi?id=52508> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-07pixmap: have slave pixmap take a reference on master pixmapDave Airlie1-0/+4
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 <airlied@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-06Make indentation of dix/tables.c much more consistent and readableAlan Coopersmith1-395/+560
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Daniel Stone <daniel@fooishbar.org>
2012-08-06Fix up formatting of initializers for arrays of structsAlan Coopersmith1-5/+5
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 <alan.coopersmith@oracle.com>
2012-07-10AllocDevicePair: Ensure XKB privates are initialisedDaniel Stone1-0/+2
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 <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10ProcGetPointerMapping uses rep.nElts before it is initializedKeith Packard1-3/+5
In: commit d792ac125a0462a04a930af543cbc732f8cdab7d Author: Alan Coopersmith <alan.coopersmith@oracle.com> 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 <keithp@keithp.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-07-10Merge branch 'local-fixes'Keith Packard1-0/+5
2012-07-09Replace padlength tables with inline functions from misc.hAlan Coopersmith1-3/+1
Adds new function padding_for_int32() and uses existing pad_to_int32() depending on required results. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Use C99 designated initializers in dix registryAlan Coopersmith1-3/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Use C99 designated initializers in dix EventsAlan Coopersmith9-200/+199
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Use C99 designated initializers in dix RepliesAlan Coopersmith7-220/+265
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Use C99 designated initializers in SendErrorToClientAlan Coopersmith1-8/+7
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 <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Use temporary variables instead of parts of reply structuresAlan Coopersmith2-11/+22
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 <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09ProcQueryKeymap: rework logic around permission to copy key statesAlan Coopersmith1-7/+9
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 <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Core events: invert check for permission to copy key statesAlan Coopersmith1-8/+10
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 <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Rework reply initialization in ProcGetProperty & NullPropertyReplyAlan Coopersmith1-13/+18
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 <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Fix more poorly indented/wrapped comments & codeAlan Coopersmith4-10/+17
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Remove unneccesary casts from WriteToClient callsAlan Coopersmith5-64/+60
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 <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09privates: Resize GPU screen-specific privates tooKeith Packard1-0/+5
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 <keithp@keithp.com>
2012-07-07dix/xf86: initial offload slave tracking (v1.1)Dave Airlie1-0/+19
add the linked list and provider hooks. v1.1: add another assert in the add path. Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-07dix/pixmap: track dirty pixmaps in server. (v4)Dave Airlie2-0/+107
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 <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-07randr: add initial scanout pixmap support (v3)Dave Airlie1-0/+29
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 <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-07dix: add ability to link output slave gpus to the current gpu (v1.1)Dave Airlie1-0/+17
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 <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-06dix: add unattached list for attaching screens to initially. (v1.1)Dave Airlie1-0/+20
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 <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-06dix: introduce gpu screens. (v5)Dave Airlie4-2/+96
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 <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-06screen: split out screen init code. (v2)Dave Airlie1-17/+27
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 <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-05privates: Allow device privates to be allocated after server startKeith Packard1-1/+21
This will permit midispcur to allocate its privates for hotplug outputs Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-07-05dix: Allocate device privates separate from devicesKeith Packard1-8/+14
This will allow device privates to be resized. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-07-05Add screen-specific privates.Keith Packard6-82/+317
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 <keithp@keithp.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-07-04dix: fix memory leak in TouchEventHistoryReplayPeter Hutterer1-2/+5
Don't leak if ti->history is NULL. Found by coverity. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-07-04dix: fix dereference before null checkPeter Hutterer1-1/+3
Found by Coverity. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-07-02Merge branch 'sigsafe-logging-varargs'Keith Packard2-4/+5
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.
2012-07-02Log messages in TouchBeginDDXTouch() in a signal-safe mannerChase Douglas1-2/+3
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>
2012-07-02Log messages in GetTouchEvents() in a signal safe mannerChase Douglas1-2/+2
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>
2012-07-02Add dixGetGlyphs to replace GetGlyphs from libXfont to simplify linkingAlan Coopersmith1-0/+9
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 <alan.coopersmith@oracle.com> Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2012-06-28dix/render: consolidate window format matching code.Dave Airlie1-0/+13
This code existed in 3 different forms, perhaps it should be consolidated. Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-06-28Merge remote-tracking branch 'whot/for-keith'Keith Packard1-6/+34
2012-06-20Fix some overly indented/poorly line wrapped comments in dix/events.cAlan Coopersmith1-14/+12
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-06-20OtherClientGone: Remove unreachable return statementAlan Coopersmith1-1/+0
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 <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>