summaryrefslogtreecommitdiff
path: root/mi
AgeCommit message (Collapse)AuthorFilesLines
2011-01-12mi: Fix the debug messagePauli Nieminen1-1/+1
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> (cherry picked from commit bf48082f30818b96bc623834be3022600371d4fc)
2010-12-15mi: handle DGA subtypes when determining the master device.Peter Hutterer1-1/+7
The subtype in the DGA event is the core type and all ET_ event types (where applicable) are identical to the core types. Thus the switch statement below will work as required and assign the right master device. Fixes a crasher bug on keyboard devices with valuators. If a device sends a motion event while grabbed and a DGA client is active (but has not selected input through DGA), the valuator event is posted through the VCK and eventually results in a NULL-pointer dereference on dev->valuator. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 31ab9f8860848504df18a8be9d19b817b191e0df)
2010-11-13mi: Integer overflow for dashed lines longer than 46340. #31093Siddhesh Poyarekar1-1/+1
Lines of length greater than 46340 can be drawn with one of the coordinates being negative. However for dashed lines, miPolyBuildPoly overflows the int type when setting up edges for a section of the dashed line. This results in the dashed segments not being drawn at all. Signed-off-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit be7cf14c365c8ee0d69c4335e01316bcfcba69a4)
2010-10-14event_size is currently never assigned to in mieqProcessInputEvents().Jon TURNEY1-0/+4
event_size is never assigned to in mieqProcessInputEvents(), so realloc() is always called. This is benign, but I'm guessing not intended. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit da4eebe58ec81e2297cc1773af1fb622fb392bbd)
2010-07-09miModifyPixmapHeader: always update serialNumberJesse Barnes1-1/+1
We should update the serial number even if we just change a single field. Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-07-07mi: rename miPointerMoved to miPointerMoveNoEvent.Peter Hutterer1-5/+5
Having miPointerMove and miPointerMoved is confusing, especially since both do the same thing bar the event delivery. Also, miPointerMove calls miPointerMoved which indicates some confusion in the temporal alignment of cause and effect. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-07-07mi: De-duplicate some code in mipointer.cPeter Hutterer1-16/+2
miPointerMoved already has the same code. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-07-02Add API to update setting of waitForUpdate screen private in miPointerAlan Coopersmith2-0/+21
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-22Revert "mi: Remove unused overlay support"Keith Packard3-1/+1981
This reverts commit 9120e58556014e514eef9dfe43cdea4b74dc66ae. Whoops, please revert this patch -- overlay is in use in nvidia drivers, and it's too late in release cycle to remove it. I feel really sorry that I kept this patch in my tree. I will submit another one, removing only XAA overlay hooks which are not used at all.
2010-06-20mi: Remove unused overlay supportMikhail Gusarov3-1981/+1
The only reference to it in server and drivers is in XAA overlay code which would segfault as no miInitOverlay is called ever. No segfaults were observed "in wild", so XAA overlay is probably also unused. XAA code is modified to act as if miOverlayCopyUnderlay always returned false, because XAACopyWindow8_32 could only set doUnderlay to true if it's called from miOverlayMoveWindow or miOverlayResizeWindow, which can only be called if miInitOverlay has hooked those functions, and no driver (on fd.o) or server code calls that. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-20mi: do not use X11/extensions/shape.h header from libXextMikhail Gusarov1-1/+1
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Tested-by: Dan Nicholson <dbn.lists@gmail.com>
2010-06-10Remove unnecessary parentheses around return values in functionsMikhail Gusarov10-19/+19
This patch was generated by the following Perl code: perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;' Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-06Remove more superfluous if(p) checks around free(p)Mikhail Gusarov7-37/+23
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ -if(E) { free(E); } +free(E); Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-06Replace deprecated bzero with memsetMikhail Gusarov1-2/+2
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Marcin Baczyński <marbacz@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-05Clean up after removal of screen parameters from region macros.Jamey Sharp7-53/+18
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05Allocate per-screen device/cursor-bits private keys in midispcurKeith Packard1-15/+14
midispcur was abusing the CursorScreenKey to index the cursor_bits privates, it also had a MAXSCREENS array of keys to index device privates. Switch both of these to the new dixCreatePrivateKey API and store a pointer to that in the screen private. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-05Change the devPrivates API to require dixRegisterPrivateKeyKeith Packard9-30/+62
This patch only changes the API, not the implementation of the devPrivates infrastructure. This will permit a new devPrivates implementation to be layed into the server without requiring simultaneous changes in every devPrivates user. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-05Create separate private key for midispcur cursor bitsKeith Packard1-17/+21
The CursorScreenKey array is supposed to be used by the DDX for cursor private data, but midispcur was abusing it to hold cursor bits private information. Create a separate set of privates for the dispcur cursor bits information. This also renames the device private index and macros to better reflect their usage: miDCSpriteKey -> miDCDeviceKey MIDCBUFFER -> miGetDCDevice Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-05Rename region macros to eliminate screen argumentKeith Packard9-464/+437
This is a combination of a huge mechanical patch and a few small fixups required to finish the job. They were reviewed separately, but because the server does not build without both pieces, I've merged them together at this time. The mechanical changes were performed by running the included 'fix-region' script over the whole tree: $ git ls-files | grep -v '^fix-' | xargs ./fix-region And then, the white space errors in the resulting patch were fixed using the provided fix-patch-whitespace script. $ sh ./fix-patch-whitespace Thanks to Jamey Sharp for the mighty fine sed-generating sed script. The hand-done changes involve removing functions from dix/region.c that duplicate inline functions in include/regionstr.h, along with their declarations in regionstr.h, mi.h and mispans.h. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Move mi/miregion.c to dix/region.cKeith Packard2-1846/+0
Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Change region implementation names to eliminate the 'mi' prefixKeith Packard4-98/+98
This prepares the file to be moved from mi to dix. This patch was done mechanically with the included scripts 'fix-miregion' run over the entire X server and 'fix-miregion-private' run over include/regionstr.h and mi/miregion.c. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-03Move each screen's x/y origin into ScreenRec.Jamey Sharp1-2/+2
Many references to the dixScreenOrigins array already had the corresponding screen pointer handy, which meant they usually looked like "dixScreenOrigins[pScreen->myNum]". Adding a field to ScreenRec instead of keeping this information in a parallel array simplifies those expressions, and eliminates a MAXSCREENS-sized array. Since dix declared the dixScreenOrigins array, I figure allocating a screen private for these values is overkill. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03Delete panoramiXdataPtr: it's redundant.Jamey Sharp1-2/+2
This eliminates a dynamically-allocated MAXSCREENS-sized array. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03Move each screen's root-window pointer into ScreenRec.Jamey Sharp3-7/+7
Many references to the WindowTable array already had the corresponding screen pointer handy, which meant they usually looked like "WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of keeping this information in a parallel array simplifies those expressions, and eliminates a MAXSCREENS-sized array. Since dix uses this data, a screen private entry isn't appropriate. xf86-video-dummy currently uses WindowTable, so it needs to be updated to reflect this change. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03Move each screen's screensaver data into ScreenRec.Jamey Sharp1-1/+1
Most references to the savedScreenInfo array already had the corresponding screen pointer handy, which meant they usually looked like "savedScreenInfo[pScreen->myNum]". Adding a field to ScreenRec instead of keeping this information in a parallel array simplifies those expressions, and eliminates a MAXSCREENS-sized array. Since dix uses this data, a screen private entry isn't appropriate. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03midispcur: Add comment explaining why pRootPicture must not be freed.Jamey Sharp1-0/+6
Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-03mi: Delete unused flicker-free MoveCursor code.Jamey Sharp3-333/+6
It's been commented-out for three and a half years and nobody seems to be missing it enough to resurrect it. Besides deleting code that is untested and therefore buggy, this saves a little memory for each pointer device on each screen. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-02Only deal with input code when changing the input shape.Pierre-Loup A. Griffais3-85/+93
Propagate the shape kind all the way to SetShape to avoid performing non-input operations such as revalidating the tree and generating exposures when only changing a window's input shape. Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Acked-by: Aaron Plattner<aplattner@nvidia.com> Reviewed-by: Daniel Stone<daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-25midispcur: Construct Picture objects lazily in case Render is disabled.Jamey Sharp1-7/+6
Reverts part of the effects of 518f3b189b6c8aa28b62837d14309fd06163ccbb, "mi: don't thrash resources when displaying the software cursor across screens". The per-screen cache is preserved, and the GCs are still allocated eagerly, but now it doesn't construct pRootPicture until somebody attempts to draw an ARGB cursor. I noticed crashes in Xnest, which doesn't support the RENDER extension, but I suspect other DDXes that support disabling that extension would have had issues as well. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
2010-05-23Device init: Don't crash when CreateGC fails.Jamey Sharp1-1/+1
ActivateDevice was ignoring errors from DeviceCursorInitialize, so cursor-related calls failed later. Jeremy Huddleston saw that crash in miPointerConstrainCursor, while with Xvfb I saw it in miSpriteRealizeCursor. miDCDeviceCleanup frees any non-NULL GCs. miDCDeviceInitialize calls Cleanup on any failure, but if it failed early then some of the pointers in the miDCBufferPtr were garbage. Switch from malloc to calloc to ensure everything's initialized safely first. With these two fixes, if CreateGC fails then the server gracefully fails in FatalError instead of segfaulting. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-19Use WriteEventsToClient rather than TryClientEvents where possible.Jamey Sharp1-2/+3
If filter is NoEventMask (aka CantBeFiltered), grab is null, and the first event is not in the set of "critical events", then TryClientEvents simply calls WriteEventsToClient. In that case, it returns 0 for fake or dead clients, and 1 otherwise. Inline for this special case. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19mi/misprite.c: Delete unused private lookups.Jamey Sharp1-18/+0
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-19Replace miSpriteCursorFuncRec with direct calls to midispcur.c.Jamey Sharp3-161/+53
Nobody wraps the mi software-cursor sprite rendering implementations. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-14scrnintstr.h: removed unused PaintWindow function pointers.Oliver McFadden1-2/+2
Please note this patch breaks the ABI. Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-14mi: removed unused PointerNonInterestBox functions.Oliver McFadden2-13/+0
Please note this patch breaks the ABI. Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Replace dixChangeGC with calls directly to the right variant.Jamey Sharp9-40/+39
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere.Jamey Sharp9-86/+98
The exceptions are ProcChangeGC and CreateGC. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Don't statically allocate the ChangeGC parameter array.Jamey Sharp1-17/+12
Because that's insane. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Simplify miFillPolyHelper and miLineArc.Jamey Sharp1-52/+27
Both functions compute a set of spans and either fill them immediately or accumulate them into a caller-provided buffer. Computing the spans used only the miTranslate and lineWidth fields of pGC, and neither could have been changed by the initial ChangeGC/ValidateGC pair, so it's safe to compute the spans first. Then both functions consume the spans the same way, so factor that into a new fillSpans function. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13miwideline: Factor out span buffer allocation.Jamey Sharp1-74/+32
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-12Kill ChangeGC in favor of dixChangeGC.Jamey Sharp1-3/+3
This doesn't change any behavior, but it isn't clear whether NullClient is correct in all cases. As ajax says, > For most of these changes, I think it's correct to use NullClient, > since they are server-initiated changes and should not fail for (eg) > xace reasons. ... At any rate, you're certainly not changing any > semantics by leaving them all as NullClient, so this patch can't be > more wrong than before. The call in CreateGC is particularly questionable. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-12Kill DoChangeGC in favor of dixChangeGC.Jamey Sharp8-26/+26
This doesn't change any behavior, but it isn't clear whether NullClient is correct in all cases. As ajax says, > For most of these changes, I think it's correct to use NullClient, > since they are server-initiated changes and should not fail for (eg) > xace reasons. ... At any rate, you're certainly not changing any > semantics by leaving them all as NullClient, so this patch can't be > more wrong than before. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Do not use deprecated Xalloc functionMikhail Gusarov1-1/+1
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov28-250/+250
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-10miPolyPoint bugfix: Check memory allocation before changing the GC.Jamey Sharp1-2/+3
miPolyPoint ought to leave the GC unchanged even if it fails. ajax says: > We have a new winner for the oldest-bug competition! It's actually > been like that since X11R1: > > -rw-r--r--. 1 ajax ajax 2817 1987-09-12 01:20 ddx/mi/mipolypnt.c Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-10Move AppendSpanGroup from miwideline.h to miwideline.c.Jamey Sharp2-27/+30
Also make it stop being a macro. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-10Expand macros that are used only in miFillPolyHelper.Jamey Sharp2-46/+41
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-07mi: Delete wide ellipse arc cacheAdam Jackson1-107/+11
This does make wide ellipses slower, by a factor of twoish: 946000.0 521000.0 ( 0.55) 10-pixel wide ellipse 98300.0 49900.0 ( 0.51) 100-pixel wide ellipse 17700.0 9310.0 ( 0.53) 500-pixel wide ellipse 16900.0 7980.0 ( 0.47) 100-pixel wide dashed ellipse 16100.0 5370.0 ( 0.33) 100-pixel wide double-dashed ellipse But no one cares, and it's a modest size win: text data bss dec hex filename 1773824 69552 59288 1902664 1d0848 hw/vfb/Xvfb.before 1773112 69552 58648 1901312 1d0300 hw/vfb/Xvfb Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07Fix mod() definition.Matthias Hopf1-1/+1
Presumably no implications, especially security-wise. Signed-off-by: Matthias Hopf <mhopf@suse.de> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-02rootless: Add some sanity checking to miPaintWindowJeremy Huddleston1-0/+3
This avoids painting the root window when it isn't actually drawable. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>