summaryrefslogtreecommitdiff
path: root/mi
AgeCommit message (Collapse)AuthorFilesLines
2016-09-22XQuartz: Adopt input_lock() and input_unlock()Jeremy Huddleston Sequoia2-34/+0
This allows us to remove darwinEvents_lock() and darwinEvents_unlock() and remove the serverRunning hack from dix Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-08-11mi: Remove spurious call to OsReleaseSignals from mieqGrowQueueKeith Packard1-1/+0
This call wasn't converted to 'input_unlock()' when the SIGIO code was removed from the server, and so when the queue growing was reworked to be done from the input thread, it got left sitting here. As the caller now manages the lock, we don't need to switch this to input_unlock at this point. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-18Remove readmask from screen block/wakeup handlerKeith Packard1-5/+3
With no users of the interface needing the readmask anymore, we can remove it from the argument passed to these functions. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-07-18dix: Switch to the libXfont2 API (v2)Keith Packard1-3/+3
This new libXfont API eliminates exposing internal X server symbols to the font library, replacing those with a struct full of the entire API needed to use that library. v2: Use libXfont2 instead of libXfont_2 Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-06-08dix: Update some comments to reflect the new non-SIGIO input modelAdam Jackson3-5/+5
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2016-05-26mi: Grow event queue while reading eventsKeith Packard1-71/+32
Now that events are read at normal process time, we can use malloc to grow the event queue instead of discarding events. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-26Create a threaded mechanism for input [v7]Keith Packard1-34/+4
The current SIGIO signal handler method, used at generation of input events, has a bunch of oddities. This patch introduces an alternative way using a thread, which is used to select() all input device file descriptors. A mutex was used to control the access to input structures by the main and input threads. Two pipes to emit alert events (such hotplug ones) and guarantee the proper communication between them was also used. Co-authored-by: Fernando Carrijo <fcarrijo@freedesktop.org> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> v2: Fix non-Xorg link. Enable where supported by default. This also splits out the actual enabling of input threads to DDX-specific patches which follow v3: Make the input lock recursive v4: Use regular RECURSIVE_MUTEXes instead of rolling our own Respect the --disable-input-thread configuration option by providing stubs that expose the same API/ABI. Respond to style comments from Peter Hutterer. v5: use __func__ in inputthread debug and error mesages. Respond to style comments from Peter Hutterer. v6: use AX_PTHREAD instead of inlining pthread tests. Suggested by Emil Velikov <emil.l.velikov@gmail.com> v7: Use pthread_sigmask instead of sigprocmask when using threads Suggested by Adam Jackson <ajax@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-05-26Remove SIGIO support for input [v5]Keith Packard2-5/+5
This removes all of the SIGIO handling support used for input throughout the X server, preparing the way for using threads for input handling instead. Places calling OsBlockSIGIO and OsReleaseSIGIO are marked with calls to stub functions input_lock/input_unlock so that we don't lose this information. xfree86 SIGIO support is reworked to use internal versions of OsBlockSIGIO and OsReleaseSIGIO. v2: Don't change locking order (Peter Hutterer) v3: Comment weird && FALSE in xf86Helper.c Leave errno save/restore in xf86ReadInput Squash with stub adding patch (Peter Hutterer) v4: Leave UseSIGIO config parameter so that existing config files don't break (Peter Hutterer) v5: Split a couple of independent patch bits out of kinput.c (Peter Hutterer) Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-25mi: Remove miPointerRec from APIKeith Packard2-12/+12
This moves the definition of miPointerRec from mipointrst.h to mipointer.c so that it is no longer visible in the API, allowing it to be changed while the API/ABI is frozen. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Signed-off-by: Keith Packard <keithp@keithp.com>
2016-05-25xwayland: Move sprite invalidation logic into mipointerKeith Packard2-0/+21
This creates a function that invalidates the current sprite and forces a sprite image reload the next time the sprite is checked, moving that logic out of the xwayland sources and allowing the miPointerRec structure to be removed from the server API. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-10-19mi: Correct a miscall of abs() to instead call fabs()Jeremy Huddleston1-1/+1
miarc.c:1714:9: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value,Semantic Issue] if (abs(parc->angle2) >= 360.0) ^ miarc.c:1714:9: note: use function 'fabs' instead [Semantic Issue] if (abs(parc->angle2) >= 360.0) ^~~ fabs Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-09-23mi: Log an error if mieqProcessInputEvents() recurses.Andy Ritger1-0/+12
v2: Uses BUG_WARN_MSG to also provide a stack trace. (Peter Hutterer) Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Andy Ritger <aritger@nvidia.com>
2015-09-23Remove static qualifier on mieqProcessInputEvents()'s 'event'Andy Ritger1-1/+1
This isn't necessary. Signed-off-by: Andy Ritger <aritger@nvidia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-08-17mi: Always initialize edge1 and edge2 in miLineArcKeith Packard1-1/+1
This eliminates a warning generated when miLineArcD is inlined and the compiler can't figure out that edge1 and edge2 are always initialized before being used. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-08-17mioverlay.c: remove shadowed pScreen.Dave Airlie1-1/+0
This is already defined at the function entry. fixes warning: CC mivaltree.lo mioverlay.c: In function 'miOverlayWindowExposures': mioverlay.c:993:23: warning: declaration of 'pScreen' shadows a previous local [-Wshadow] ScreenPtr pScreen = pWin->drawable.pScreen; ^ mioverlay.c:986:15: note: shadowed declaration is here ScreenPtr pScreen = pWin->drawable.pScreen; Signed-off-by: Dave Airlie <airlied@redhat.com>> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-07-08dix: Restore PaintWindow screen hookAdam Jackson4-34/+17
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-08mi: Remove questionable optimization from the rootless pathAdam Jackson1-3/+0
This is effectively a revert of 7b506fdc840aebed6b5acb91437a2cb620b5bddc except the coding style reindent broke that. The code makes no sense in any case. drawable can never be null since it's the first member of WindowRec, and we're never called with a null window. Neither can it be an UNDRAWABLE_WINDOW since those are InputOnly windows; the rootless code does not set the root window to either UNDRAWABLE or InputOnly, so. 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 Jackson1-0/+1
Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-07-06mi: fix typo in warning about overflowing queueJulien Cristau1-1/+1
Debian bug#726041 Reported-by: Vincent Hobeïka <vincent.hobeika@gmail.com> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-06-29Fix border tile origin when background is ParentRelativePeter Harris1-4/+9
According to http://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html#requests:CreateWindow "The border tile origin is always the same as the background tile origin." ChangeWindowAttributes goes to some effort to make sure it repaints the border tile whenever the background origin may have changed, but miPaintWindow was ignoring the background origin. Found by xts XChangeWindowAttributes-3 Signed-off-by: Peter Harris <pharris@opentext.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-06-30cursor: drop ARGB_CURSORDave Airlie1-19/+1
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-04-21Convert mi & miext to new *allocarray functionsAlan Coopersmith15-67/+62
v2: remove now useless parentheses Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-13mi: Partial pie-slice filled arcs may need more space for spansKeith Packard1-0/+5
The mi filled arc code estimates that a filled arc will produce no more spans than the arc is tall. This is true for most arcs except for pie-slice arcs strictly between 180 and 360 degrees where the missing portion of the arc faces up or down such that we get two spans on some scanlines. For those, we need to reserve room for another height/2 spans. This patch just does it for all partial pie-sliced arcs to make the test easier to understand; it's just over-allocating a bit of memory, so that's safe. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2015-03-31Fix XQuartz buildJon Turney1-0/+3
Fix XQuartz build since commit e036cbfc "Make PseudoramiXExtensionInit() prototype more generally available" Add #include "nonsdk_extinit.h" to xprScreen.c Add #include "nonsdk_extinit.h" to miinitext.c under INXQUARTZ to provide declarations used under INXQUARTZ Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Tested-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-05mi: fix accidental x/y coordinate swapPeter Hutterer1-2/+2
Reported-by: Adam Greenblatt <adam.greenblatt@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-11-24mi: Fix regression in arc drawingAdam Jackson1-15/+0
xts' XDrawArcs/15 regressed (turning into a server-side infinite loop) after: commit 7679afd4da8b86aed27e5916ba723116a3c8bb4a Author: Adam Jackson <ajax@redhat.com> Date: Fri Sep 26 12:01:37 2014 -0400 mi: Fold mifpolycon.c into miarc.c The reason is miarc.c provided its own definitions (sigh) of min/max, that both accept int arguments and return an int. Since miFillSppPoly uses a double (sigh) and some min-involving math for its loop index variable, things do not go well. Since the integer versions of min/max are redundant, nuke 'em. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Tested-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-11-12mi: fix documentation for miPointerSetPositionPeter Hutterer1-0/+5
Changed when we added barriers, documentation didn't get updated. Reported-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com>
2014-11-12Drop trailing whitespacesPeter Hutterer23-116/+116
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-10-27dix: Always store GC client clip as a region (v2)Adam Jackson4-40/+14
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-27mi: Fold micursor.c into mipointer.cAdam Jackson3-69/+14
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Fold mipolyutil.c into mipoly.cAdam Jackson4-387/+285
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Fold mipoly{con,gen}.c into mipoly.cAdam Jackson5-471/+329
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Fold mifpolycon.c into miarc.cAdam Jackson6-293/+205
Also put mifpoly.h on a diet, and stop including it from places that don't need it. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Fold mispans.c into miwideline.cAdam Jackson5-612/+518
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Unexport arc fill implementation detailsAdam Jackson3-12/+3
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Unexport subpixel polygon implementation detailsAdam Jackson2-10/+9
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Unexport span group implementation detailsAdam Jackson2-13/+9
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Unexport polygon edge table implementation detailsAdam Jackson1-13/+10
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Unexport wide line detailsAdam Jackson3-30/+5
XAA wanted these, once upon a time, but that's gone now. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-23mi: Mark the span blit routines as _X_COLDAdam Jackson2-8/+7
On gcc, __attribute__((cold)) means: - consider calls to the function to be unlikely for branch prediction - optimize the function for size - emit the function in a dedicated cold text section It's not worth deleting these routines even though there are no longer in-tree consumers, but we can at least keep them out of i$ at runtime. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-09misc: Fold together some redundant conditionalsAdam Jackson2-21/+15
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09mi: miSlideAndSizeWindow -> miResizeWindowAdam Jackson3-10/+9
Make the function name match the screen slot name. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09dix: Lower backStorage to a bit instead of a pointerAdam Jackson1-1/+1
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09mi: Move pScreen->SendGraphicsExpose up to dixAdam Jackson3-55/+0
No DDX is overriding this and it's fairly absurd to expose it as a screen operation anyway. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09mi: Drop plane argument from miHandleExposuresAdam Jackson4-14/+5
This existed to be passed to the bs recovery routine; since we back all planes, we don't care. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09mi: Simplify composite border clip redirection interfaceAdam Jackson2-44/+19
There's not really a good reason for mi to not just call the composite code directly. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09mi: Deobfuscate miOverlayWindowExposuresAdam Jackson1-28/+12
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09mi: Deobfuscate miWindowExposuresAdam Jackson1-30/+11
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09dix: Drop the third argument from WindowExposuresProcPtrAdam Jackson4-39/+14
A careful read shows that it was always NULL. It hasn't always been; as the DDX spec indicates, it was the "occluded region that has backing store", but since that backing store code is long gone, we can nuke it. mi{,Overlay}WindowExposures get slightly simpler here, and will get even simpler in just a moment. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>