Commit Graph

733 Commits

Author SHA1 Message Date
Tiago Vignatti aa7096ca6f xorg: remove unused pointer values all over the server
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-04 15:41:13 +03:00
Erkki Seppälä f985a7319e mi/misprite: use memory management provided by dixRegisterPrivateKey
The record allocated by miSpriteDeviceCursorInitialize was not being
released.

This patch makes misprite use dixRegisterPrivateKey with the record
size argument, which handles the memory management issues.
miSpriteDeviceCursorInitialize is restructured to initialize pCursorInfo
only if miDCDeviceInitialize succeeds. The record itself is zeroed on
cleanup to ensure that the assumptions in the code still hold.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
2011-03-14 14:01:01 -04:00
Adam Jackson 810fbfa446 mi: Call pScreen->ConstrainCursorHarder from the position update path
v2: Cover more paths, spotted by Daniel Stone.
v3: pass down the mode field for movement mode.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-14 13:35:51 -04:00
Peter Hutterer 769531b9cc Add mode field to pointer movement hooks.
Preparation work for pointer barriers.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-14 13:25:14 -04:00
Peter Hutterer 17265ccb02 Move master/lastSlave out of the union into separate fields.
The removal of the double-use will cause some suble bugs as some conditions
to check for the dev->u.master case were broken and also evaluated as true
if lastSlave was set (instead of master).

Also breaks the input ABI.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:45 +10:00
Peter Hutterer 77113dd3ee input: Change a bunch of direct dev->u.master accesses to use GetMaster()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:45 +10:00
Peter Hutterer 0ba526deeb mi: check for MASTER_POINTER instead of manual checks.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:45 +10:00
Peter Hutterer 52c13896ce mi: update macro to search for MASTER_POINTER
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:45 +10:00
Peter Hutterer dc57f89959 Switch to use IsFloating()
This is not a straightforward search/replacement due to a long-standing
issue.

dev->u.master is the same field as dev->u.lastSlave. Thus, if dev is a master
device, a check for dev->u.master may give us false positives and false
negatives.
The switch to IsFloating() spells out these cases and modifies the
conditions accordingly to cover both cases.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:44 +10:00
Peter Hutterer dc32a23890 Fix two incorrect checks for master devices.
These two were sideeffects of lastSlave being in the same field as the
master. For devices generated by the master device directly, lastSlave was 0
and the device would (with the old checks) be interpreted as floating.

Add the required checks to safeguard against master devices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:44 +10:00
Peter Hutterer c2a9e0a969 mi: simplify a "check for keyboard" condition
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:44 +10:00
Peter Hutterer 3a6160b408 mi: remove if 0 code.
Note sure why this is in if 0 but it's been that way since 2007.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:44 +10:00
Peter Hutterer d9987c8c45 mi: Add a few comments explaining various cursor move functions.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:44 +10:00
Peter Hutterer 15fe86e69f mi: remove static GenerateEvent variable.
Push into the respective devices. This should have no functional changes
since we never warp more than one device at a time. In the glorious future
with true multithreading, still the better thing to do.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:43 +10:00
Tomas Carnecky aa30a86583 NO_PANORAMIX preprocessor symbol is nowhere defined
Which makes it useless, so remove it.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-01-07 09:30:45 +10:00
Ville Syrjälä 0998574699 Call SourceValidate even if src == dst
The extra SourceValidate calls from damageCopyArea and damageCopyPlane
can be removed.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-01-05 11:56:42 -08:00
Ville Syrjälä e41e907b3c Add subWindowMode parameter to SourceValidate
Pass the subWindowMode from the GC/source Picture to SourceValidate.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-01-05 11:56:28 -08:00
Pauli Nieminen 13ac3deedb mi: Only register sprite block handler when needed
miSpriteBlockHandler takes about 10us in arm each time BlockHandlers are
called. To eliminate that overhead from xserver side only register the
BlockHandler when there actually is any cursor down.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31 12:52:51 +00:00
Pauli Nieminen 4f6e3b0f37 mi: Register sprite damage handler only when required
There is no need to have damage handler registered when there isn't any
pointer in the screen. This avoids some overhead from damage handling
which takes tens of microseconds on arm.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31 12:52:51 +00:00
Pauli Nieminen bf48082f30 mi: Fix the debug message
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>
2010-12-31 12:52:51 +00:00
Pauli Nieminen 8fb43b8bf9 mi: Fix wrapping for sprite screen
SCREEN_EPILOGUE should read the current function pointer from screen
after calling wrapped function in case the pointer changes.

Passing pPriv to macros instead of asking dix each time makes sense when
both macros need same pointer.

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>
2010-12-31 12:52:51 +00:00
Pauli Nieminen 4be2a6d1b3 mi: Add GetSpriteScreen macro to hide dixLookupPrivate
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31 12:52:51 +00:00
Alan Coopersmith 2db6951763 Sun's copyrights now belong to Oracle
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-12-07 11:10:35 -08:00
Peter Hutterer 31ab9f8860 mi: handle DGA subtypes when determining the master device.
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>
2010-12-07 08:07:54 +10:00
Adam Jackson 63b9d67d7f mi: Remove unused miAllocateGCPrivateIndex
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30 13:46:09 -05:00
Adam Jackson fba5c8154d dix: Remove unused ChangeSaveUnder hooks
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30 13:46:09 -05:00
Adam Jackson c4c4676e68 dix: Remove the backing store leftovers
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30 13:46:08 -05:00
Peter Hutterer 88cb61e1e5 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-api
Conflicts:
	dix/getevents.c
	hw/xfree86/common/xf86Xinput.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-11 12:54:46 +10:00
Keith Packard 4ed4915bc0 Merge remote branch 'whot/for-keith' 2010-11-10 16:58:21 -08:00
Siddhesh Poyarekar be7cf14c36 mi: Integer overflow for dashed lines longer than 46340. #31093
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>
2010-11-10 14:55:21 -08:00
Cyril Brulebois b142b0d274 Remove more superfluous if(p!=NULL) checks around free(p).
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@
- if (E != NULL)
-   free(E);
+ free(E);

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-11 08:29:54 +10:00
Peter Hutterer 675f4a8525 Abstract valuator masks through a set of APIs.
This commit introduces an abstraction API for handling masked valuators. The
intent is that drivers just allocate a mask, set the data and pass the mask
to the server. The actual storage type of the mask is hidden from the
drivers.

The new calls for drivers are:
    valuator_mask_new()     /* to allocate a valuator mask */
    valuator_mask_zero()    /* to reset a mask to zero */
    valuator_mask_set()     /* to set a valuator value */

The new interface to the server is
    xf86PostMotionEventM()
    xf86PostButtonEventM()
    xf86PostKeyboardEventM()
    xf86PostProximityEventM()

all taking a mask instead of the valuator array.

The ValuatorMask is currently defined for MAX_VALUATORS fixed size due to
memory allocation restrictions in SIGIO handlers.

For easier review, a lot of the code still uses separate valuator arrays.
This will be fixed in a later patch.

This patch was initially written by Chase Douglas.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 11:02:48 +10:00
Jon TURNEY da4eebe58e event_size is currently never assigned to in mieqProcessInputEvents().
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>
2010-10-13 09:46:26 -07:00
Jamey Sharp 402942cdbc Introduce per-object per-screen privates.
This replaces dixCreatePrivateKey and the only uses, which were in
midispcur.

Commit by Jamey Sharp and Josh Triplett.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-09-18 11:17:18 +02:00
Jamey Sharp ccdf156890 miPolyGlyphBlt: Delete redundant ValidateGC.
The caller is required to have validated the GC for the drawable before
calling any ops, including PolyGlyphBlt.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-09-13 15:58:08 -07:00
Tiago Vignatti 5098801b3a mi: delete unused code
pBSReg is always NULL, so the statement after the conditional will never be
reached.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-09-10 21:49:29 +03:00
Jesse Barnes 02b11509b2 miModifyPixmapHeader: always update serialNumber
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-09 16:13:03 -07:00
Peter Hutterer b46ffd25d3 mi: rename miPointerMoved to miPointerMoveNoEvent.
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-07 13:29:45 +10:00
Peter Hutterer dbd621705a mi: De-duplicate some code in mipointer.c
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-07 13:27:09 +10:00
Alan Coopersmith 3d9079b898 Add API to update setting of waitForUpdate screen private in miPointer
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-07-02 14:27:49 +10:00
Keith Packard e2918b6739 Revert "mi: Remove unused overlay support"
This reverts commit 9120e58556.

 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-22 12:11:20 -07:00
Mikhail Gusarov 9120e58556 mi: Remove unused overlay support
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-20 05:36:22 +07:00
Mikhail Gusarov 91b5aadbdf mi: do not use X11/extensions/shape.h header from libXext
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Tested-by: Dan Nicholson <dbn.lists@gmail.com>
2010-06-20 05:36:22 +07:00
Mikhail Gusarov 7287ef9e6c Remove unnecessary parentheses around return values in functions
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-10 06:42:42 -07:00
Mikhail Gusarov 0a4d8cbdcd Remove more superfluous if(p) checks around free(p)
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-06 20:27:18 +07:00
Mikhail Gusarov 5a0fc0ad21 Replace deprecated bzero with memset
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-06 15:07:27 +07:00
Jamey Sharp a0fe6987b5 Clean up after removal of screen parameters from region macros.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05 22:07:21 -07:00
Keith Packard ab07e2b8ed Allocate per-screen device/cursor-bits private keys in midispcur
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-05 19:31:37 -07:00
Keith Packard faeebead7b Change the devPrivates API to require dixRegisterPrivateKey
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-05 19:23:03 -07:00
Keith Packard c865a24401 Create separate private key for midispcur cursor bits
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-05 19:16:56 -07:00
Keith Packard 2dc138922b Rename region macros to eliminate screen argument
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-05 18:59:00 -07:00
Keith Packard d17e726e89 Move mi/miregion.c to dix/region.c
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 17:48:20 -07:00
Keith Packard 9b6f5f549d Change region implementation names to eliminate the 'mi' prefix
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-05 17:47:32 -07:00
Jamey Sharp a83cff9f4d Move each screen's x/y origin into ScreenRec.
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-03 14:03:23 -07:00
Jamey Sharp 217ccaa5a3 Delete panoramiXdataPtr: it's redundant.
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-03 14:03:23 -07:00
Jamey Sharp e7fae9ecc4 Move each screen's root-window pointer into ScreenRec.
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-03 14:03:23 -07:00
Jamey Sharp 80b5d3a326 Move each screen's screensaver data into ScreenRec.
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-03 14:03:22 -07:00
Jamey Sharp 5030540d6c midispcur: Add comment explaining why pRootPicture must not be freed.
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-03 14:03:22 -07:00
Jamey Sharp f308cbea8c mi: Delete unused flicker-free MoveCursor code.
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-03 14:03:22 -07:00
Pierre-Loup A. Griffais 643cb6e87c Only deal with input code when changing the input shape.
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-06-02 21:11:31 -07:00
Jamey Sharp bf78e11839 midispcur: Construct Picture objects lazily in case Render is disabled.
Reverts part of the effects of 518f3b189b,
"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-25 09:05:37 -07:00
Jamey Sharp b9f48d60bc Device init: Don't crash when CreateGC fails.
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-23 17:28:44 -07:00
Jamey Sharp 90e612dcbe Use WriteEventsToClient rather than TryClientEvents where possible.
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-19 12:32:34 -07:00
Jamey Sharp e1e7deefb5 mi/misprite.c: Delete unused private lookups.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-19 10:00:51 -07:00
Jamey Sharp 936b09f2a3 Replace miSpriteCursorFuncRec with direct calls to midispcur.c.
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-19 10:00:49 -07:00
Oliver McFadden a4fbc0feda scrnintstr.h: removed unused PaintWindow function pointers.
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-14 08:27:10 +03:00
Oliver McFadden 71296885b0 mi: removed unused PointerNonInterestBox functions.
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-14 07:50:49 +03:00
Jamey Sharp 6a84cd9434 Replace dixChangeGC with calls directly to the right variant.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:14:07 -07:00
Jamey Sharp e2929db7b7 dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere.
The exceptions are ProcChangeGC and CreateGC.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:13:48 -07:00
Jamey Sharp 95728ca09d Don't statically allocate the ChangeGC parameter array.
Because that's insane.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 16:24:54 -07:00
Jamey Sharp bff8525f84 Simplify miFillPolyHelper and miLineArc.
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-13 16:24:54 -07:00
Jamey Sharp 83f7ec9727 miwideline: Factor out span buffer allocation.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-13 16:24:54 -07:00
Jamey Sharp 04bad1b8a1 Kill ChangeGC in favor of dixChangeGC.
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-12 18:10:01 -07:00
Jamey Sharp 65cedf3905 Kill DoChangeGC in favor of dixChangeGC.
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-12 18:09:55 -07:00
Mikhail Gusarov f62ba192c2 Do not use deprecated Xalloc function
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13 04:53:30 +07:00
Mikhail Gusarov 3f3ff971ec Replace X-allocation functions with their C89 counterparts
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-13 00:22:37 +07:00
Jamey Sharp 4080cd42fd miPolyPoint bugfix: Check memory allocation before changing the GC.
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-10 11:16:33 -07:00
Jamey Sharp ccdaecc547 Move AppendSpanGroup from miwideline.h to miwideline.c.
Also make it stop being a macro.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-10 11:16:32 -07:00
Jamey Sharp 4272d6722c Expand macros that are used only in miFillPolyHelper.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-10 11:16:32 -07:00
Adam Jackson 946f664b6a mi: Delete wide ellipse arc cache
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-07 22:03:09 -07:00
Matthias Hopf e2e2747f40 Fix mod() definition.
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-07 12:22:02 -07:00
Jeremy Huddleston 7b506fdc84 rootless: Add some sanity checking to miPaintWindow
This avoids painting the root window when it isn't actually drawable.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-05-02 15:27:29 -07:00
Keith Packard 0e91e19f78 Merge remote branch 'vignatti/for-keith' 2010-04-30 12:27:51 -07:00
Adam Jackson ffaae7c0c6 Remove mibank support
Banked framebuffers are so 1990.  As of 7.4 the only drivers remaining
that used this were chips, neomagic, trident, and vesa.  vesa only used
it when not using shadowfb, which is broadly undesirable anyway, and no
longer uses it at all as of 2.3.0.  neomagic never used it by default,
and support for it is gone in git master.  The other two effectively
only ever used it for ISA chips; since ISA support is now gone from
the server, they have been modified to only compile mibank support when
ISA support is available.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-27 11:14:03 -07:00
Keith Packard 3f63db8919 Merge remote branch 'jamey/for-keith' 2010-04-26 20:18:13 -07:00
Pierre-Loup A. Griffais 518f3b189b mi: don't thrash resources when displaying the software cursor across screens
This changes the DC layer to maintain a persistent set of GCs/pixmaps/pictures
for each pScreen instead of failing to thrash between them when changing
screens.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-26 19:40:12 -07:00
Jamey Sharp e372cc58e0 Boolean-or short-circuits, so (a || (!a && ...)) is redundant. Simplify.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-04-26 19:18:41 -07:00
Tiago Vignatti a94f5455c7 mi: track screens' installed colormaps as screen privates
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-04-23 15:49:23 +03:00
Keith Packard 7ac6a6b7d0 Merge remote branch 'vignatti/for-keith'
Conflicts:
	exa/exa.c

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 16:07:38 -07:00
Peter Hutterer e3d2a7a613 Revert "mi: don't thrash resources when displaying the software cursor across screens"
This commit leads to a segfault on the very first XTS test case.

Backtrace:
0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db]
1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75]
2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c]
3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579]
4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830]
5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33]
6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79]
7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e]
8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe]
9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a]
10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a)
[0x73969a]
11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5]
12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d]
13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6]
14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1]
Segmentation fault at address 0x10b2d5f8

valgrind output:
==5069== Invalid read of size 4
==5069==    at 0x80F928D: FreePicture (picture.c:1531)
==5069==    by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867)
==5069==    by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968)
==5069==    by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292)
==5069==    by 0x807973E: CloseDevice (devices.c:840)
==5069==    by 0x80799B6: CloseDownDevices (devices.c:933)
==5069==    by 0x8062705: main (main.c:309)
==5069==  Address 0x4cce844 is 12 bytes inside a block of size 84 free'd
==5069==    at 0x40057F6: free (vg_replace_malloc.c:325)
==5069==    by 0x80A3DE0: Xfree (utils.c:1154)
==5069==    by 0x80F9332: FreePicture (picture.c:1576)
==5069==    by 0x80FBB4B: PictureDestroyWindow (picture.c:69)
==5069==    by 0x810B1A3: damageDestroyWindow (damage.c:1840)
==5069==    by 0x80864F1: FreeWindowResources (window.c:846)
==5069==    by 0x8086812: DeleteWindow (window.c:925)
==5069==    by 0x806B53E: FreeClientResources (resource.c:806)
==5069==    by 0x806B60F: FreeAllResources (resource.c:823)
==5069==    by 0x80626E4: main (main.c:299)
==5069==
==5069== Invalid write of size 4
==5069==    at 0x80F9295: FreePicture (picture.c:1531)
==5069==    by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867)
==5069==    by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968)
==5069==    by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292)
==5069==    by 0x807973E: CloseDevice (devices.c:840)
==5069==    by 0x80799B6: CloseDownDevices (devices.c:933)
==5069==    by 0x8062705: main (main.c:309)
==5069==  Address 0x4cce844 is 12 bytes inside a block of size 84 free'd
==5069==    at 0x40057F6: free (vg_replace_malloc.c:325)
==5069==    by 0x80A3DE0: Xfree (utils.c:1154)
==5069==    by 0x80F9332: FreePicture (picture.c:1576)
==5069==    by 0x80FBB4B: PictureDestroyWindow (picture.c:69)
==5069==    by 0x810B1A3: damageDestroyWindow (damage.c:1840)
==5069==    by 0x80864F1: FreeWindowResources (window.c:846)
==5069==    by 0x8086812: DeleteWindow (window.c:925)
==5069==    by 0x806B53E: FreeClientResources (resource.c:806)
==5069==    by 0x806B60F: FreeAllResources (resource.c:823)
==5069==    by 0x80626E4: main (main.c:299)

XTS test case: Xproto pAllocColor

This reverts commit 00b8b7ad61.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 15:54:21 -07:00
Tiago Vignatti 099946a3ac mi: check for NULL pointer before dereferences it in miPointerSetPosition
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-21 18:07:08 +03:00
Tiago Vignatti 0ba82562ee Death to Multibuffer extension
The rationale behind is because no sane application will use this when we have
modern APIs such DRI2. Besides, as a fact, xfree86 server has already
deprecated this extension in 1998:

    http://www.xfree86.org/3.3.6/isc7.html

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-04-21 18:06:35 +03:00
Keith Packard 28b7b2b8d0 unifdef -B -DRENDER to always include RENDER code
This patch was created with:

git ls-files '*.[ch]' | while read f; do unifdef -B -DRENDER -o $f $f; done

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-19 09:26:10 -07:00
Peter Hutterer 241b53b777 mi: remove log-spamming bogus error message (#26843)
miSpriteRealizeCursor is called whenever a device is set floating and it's
fine to do so, no need for an error message.
Same goes for the other miSprite messages.

X.Org Bug 26843 <http://bugs.freedesktop.org/show_bug.cgi?id=26843>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-16 07:53:24 +10:00
Pierre-Loup A. Griffais 00b8b7ad61 mi: don't thrash resources when displaying the software cursor across screens
This changes the DC layer to maintain a persistent set of GCs/pixmaps/pictures
for each pScreen instead of failing to thrash between them when changing
screens.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-16 07:53:19 +10:00
Yaakov Selkowitz 822b9f9a3e mi: remove deprecated #include <X11/extensions/xf86bigfstr.h> in miinitext.c
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-03-22 00:47:09 -05:00
Alan Coopersmith 895f40792a Add type name argument to CreateNewResourceType
Convert all calls of CreateNewResourceType to pass name argument

Breaks DIX ABI.

ABI versions bumped:

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18 17:44:12 -08:00
Alan Coopersmith a11c58fa0c Ensure all resource types created have names registered
Calls RegisterResourceName to record the type name for
use by X-Resource, XACE/SELinux/XTsol, and DTrace.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-18 16:51:45 -08:00
Alan Coopersmith c9726bbe31 Update Sun license notices to current X.Org standard form
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-16 17:11:35 -08:00
Alan Coopersmith 2bd71a6db2 Fix segfault when -extension XKEYBOARD is passed on the command line
Users should be told they can't disable XKB or XInput via error messages,
not core dumps.

Reported by T`2 on #xorg irc

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-18 22:55:37 +09:00
Jeremy Huddleston b3415187e9 Rootless: Correct border rendering on parent-relative windows
Resurected code from the punted RootlessPaintBackground/Border and added it conditionally to miPaintWindow
(cherry picked from commit cf2e3312cf)
2009-09-27 23:31:50 -07:00
Jeremy Huddleston 226b1033b4 XQuartz: Transition from xEvent based mieq to InternalEvent
(cherry picked from commit a3dbde2de8)
2009-09-27 23:31:07 -07:00
Kevin E Martin c9ec2bab2f dmx: undefine MITSHM, move undefs to miinitext.c.
This patch undefines MITSHM for dmx - we don't support the required
screen->ModifyPixmapHeaders. All undefines are moved from dmx-config to
miinitext.c, where they belong.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-26 13:14:50 +10:00
Peter Hutterer 90aa0e4a49 input: don't use typecasts to access members of InternalEvent.
To avoid confusion, the member names are now postfixed with _event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-22 11:15:32 +10:00
Keith Packard 8b5086250a Eliminate bogus event resizing.
Now that all event queues hold internal events only, they never need
to be resized. Resizing them led to memory corruption as they would
get sized for an appropriate xEvent, not an internal event.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-20 20:45:24 +10:00
Peter Hutterer b968237131 mi: include shmint.h if needed, silence compiler warning.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24 10:09:14 +10:00
Tiago Vignatti 93d9646c71 mi: fix indentation
mieq.c looks indented-wise now. Let's see how long it will take to someone
mess it again.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-08-08 20:18:10 +03:00
Tiago Vignatti f9a2fff224 mi: fix cursor warping screens
The server was processing ET_RawMotion type when the cursor was wrapping to
another screen and getting wrong valuator values. This fix such issue
considering only ET_Motion, ET_KeyPress, ET_KeyRelease, ET_ButtonPress and
ET_ButtonRelease types when the cursor detects a new screen, keeping the
"normal" processing of device events.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-08 20:09:32 +03:00
Peter Hutterer 3d3b8babd1 mi: update master event copying to InternalEvents.
This is long overdue. The device events are InternalEvents now (and only one
at a time), diminishing the need for an EventList for the master event.
Furthermore, don't make masterEvent a static since this will interfere if
mieqProcessDeviceEvent is called from somewhere else (e.g. XKB actions).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30 08:43:13 +10:00
Peter Hutterer 4e9b2938cd include: untangle events.h from the SDK headers.
InternalEvents shouldn't be used anywhere outside the X server itself. Split
up into events.h for opaque typedefs for the events needed by various
headers and eventstr.h for the actual struct definitions.

eventstr.h must only be included by code that requires internal events and
is not part of the SDK.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30 08:43:13 +10:00
Jeremy Huddleston b8e0f74082 mieq: Protect from pDev=NULL in mieqEnqueue and mieqProcessInputEvents
(cherry picked from commit bf60ffb497)
2009-07-25 20:17:25 -07:00
Peter Hutterer 20daa145c4 mi: fix build error caused by missing xtest.h
xtest.h was renamed to xtestconst.h in xextproto.
Requires xextproto 7.0.99.3

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-23 08:38:58 +10:00
Pierre Willenbrock 9965174f4f Check dev->u.master if there is a custom event handler, too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-17 14:40:54 +10:00
Pierre Willenbrock c806162c13 Always update u.lastSlave
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-17 14:40:54 +10:00
Peter Hutterer d3f6b43a24 Update to xextproto 7.0.99.1.
xextproto had Xlib client headers moved into libXext.
Protocol header files are named fooproto.h, header files with constants
foo.h or fooconst.h where foo.h was already in use for client-side headers.
2009-07-15 17:00:05 +10:00
Peter Hutterer d040af7fa3 Update to type-specific raw events - require inputproto 1.9.99.14.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-15 10:36:30 +10:00
Peter Hutterer b773b4e8e0 s/MAX_DEVICES/MAXDEVICES/ updates.
The number of input devices is MAXDEVICES, not MAX_DEVICES (f781a752e6)
Two comments updated to refer to MAXDEVICES.

MAX_FUNCS in sigio.c was set to 16 if MAX_DEVICES was undefined. If more
than 15 physical input devices were present, this could result in a
failure to install the SIGIO handler for any device above 15.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-06 12:58:39 +10:00
David Miller afa680e495 mi: ignore DGA events in ChangeDeviceID
DGA events don't have a deviceid, so they don't need changing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-18 08:23:30 +10:00
Peter Hutterer 6de67d3206 Merge branch 'master' into xi2 2009-06-03 16:11:33 +10:00
Peter Hutterer af4e658401 mi: only process master if the SD is still attached.
SDs may be detached during event processing (e.g. if a passive grab
activates). In this case, the event must not be processed through the master
device.

Reported-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-03 14:38:55 +10:00
Jeremy Huddleston f2151f1b0d XQuartz: Fix alpha to be 1 (screenshots bug, etc)
This is related to: bc964ff1e3
XQuartz: Stab at fixing the alpha 0/1 bug (screenshots, etc) by pulling in some old code that got gutted from rootless.

which was on the 1.4 branch and implemented in fbPaintWindow.  Now that fbPaintWindow is gone, this is now in miPaintWindow().
(cherry picked from commit 032173f693)
2009-05-29 14:48:18 -07:00
Peter Hutterer d7aef3f663 Merge branch 'master' into xi2
Conflicts:
	Xext/geext.c
	Xi/chdevcur.c
	Xi/extgrbdev.c
	Xi/xiproperty.c
	configure.ac
	dix/ptrveloc.c
	hw/xfree86/common/xf86Config.c
	mi/mipointer.h
	test/input.c
	xkb/xkb.c
2009-05-28 17:20:58 +10:00
Peter Hutterer b25e29e801 mi: use GetMaster() from MIPOINTER and MISPRITE.
Both may in some cases be called for a SD attached to a master keyboard. In
this case, we need to get the right master device (i.e. the pointer).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:57 +10:00
Peter Hutterer ebe45e1a72 input: introduce partial class copying depending on the event.
Copying all classes into the master device has drawbacks for hybrid devices
(devices that are both mice and keyboards). If such a device posts an event,
it's key classes are moved into the VCP. The key event itself is unaffected
by keyboard grabs and the like.

Partial class copying copies depending on the event and copies the classes
into the right master device (i.e. the VCK for key events, the VCP for
pointer events).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:57 +10:00
Peter Hutterer 438a4eafa5 input: remove nested union from InternalEvent.
There's no need for internal events to be a struct with a single nested
union, we might as well make the union itself the InternalEvent.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:56 +10:00
Peter Hutterer b12d302df8 Input: rename DeviceIntRec->isMaster to ->type.
isMaster is not enough as long as we differ between master pointers and
keyboard. With flexible device classes, the usual checks for whether a
master device is a pointer (currently check for ->button, ->valuators or
->key) do not work as an SD may post an event through a master and mess this
check up.

Example, a device with valuators but no buttons would remove the button
class from the VCP and thus result in the
IsPointerDevice(inputInfo.pointer) == FALSE.

This will become worse in the future when new device classes are introduced
that aren't provided in the current system (e.g. a switch class).

This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and
MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an
IsMaster(dev).
2009-05-22 15:44:50 +10:00
Peter Hutterer add2defac7 Split the signal-handler's lastSlave out into a separate variable.
dev->u.lastSlave was not signal safe since it was accessed by the DIX and
during signal handling.
Replaced with:
'dev->last.slave' for the signal handler's lastSlave (used to generate
                  DeviceChangedEvents), .
'dev->u.lastSlave' for the DIX lastSlave (currently only used in
                   change_modmap)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:03 +10:00
Peter Hutterer bbf266cca3 mi: un-deprecate miPointerWarpCursor
This function was deprecated in ef68273f5b
because it didn't take a device argument. The device argument was added in
1c7568b8a1 though, so the deprecation is
obsolete.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-16 12:20:58 +10:00
Peter Hutterer c1d7deca92 mi: un-deprecate miPointerWarpCursor
This function was deprecated in ef68273f5b
because it didn't take a device argument. The device argument was added in
1c7568b8a1 though, so the deprecation is
obsolete.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-16 12:01:22 +10:00
Adam Jackson c66cf7b64c Update several of my and/or Red Hat's licenses to standard form. 2009-05-14 07:02:44 -04:00
Peter Hutterer 749cae8220 mi: don't crash if we're trying to update the pointer for a keyboard.
If a device doesn't have a pointer, just return.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-05 14:12:04 +10:00
Peter Hutterer 3d30789a05 mi: don't crash if we're trying to update the pointer for a keyboard.
If a device doesn't have a pointer, just return.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-01 09:07:39 +10:00
Eamon Walsh 57aff88c7d Fix most remaining deprecated resource lookups.
Callsites updated to use dixLookupResourceBy{Type,Class}.
TODO: Audit access modes to make sure they reflect the usage.
2009-04-29 01:04:37 -04:00
Peter Hutterer 057fc9a4f8 Merge branch 'master' into xi2
Conflicts:
	Xi/chdevhier.c
	include/input.h
2009-04-24 16:15:47 +10:00
Peter Hutterer 932d6bcbb6 mi: remove superfluous check.
mieqProcessInputEvents doesn't process events from MDs anymore, so we don't
need to check for pDev->isMaster.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-24 15:29:24 +10:00
Peter Hutterer f2e957c534 mi: add prototype for CopyGetMasterEvent.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:18:15 +10:00
Peter Hutterer d80798ba2a mi: fix wrong (*EnqueueEvent) declaration in miPointerScreenFuncRec.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:18:14 +10:00
Peter Hutterer 4fa7fcf610 mi: fix compiler warning - explicitly typecast to InternalEvent.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:18:14 +10:00
Peter Hutterer fcc19e673e mi: fix wrong (*EnqueueEvent) declaration in miPointerScreenFuncRec.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-09 20:50:32 +10:00
Peter Hutterer 630a6e9d14 mi: fix compiler warning - explicitly typecast to InternalEvent.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-09 20:50:32 +10:00
Peter Hutterer e3bb7dea06 mi: add prototype for CopyGetMasterEvent.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-09 20:50:32 +10:00
Peter Hutterer 6c3b633299 Merge branch 'master' into xi2 2009-04-07 19:36:27 +10:00
Adam Jackson 17239c8e31 misprite: Remove private header, fold into misprite.c 2009-03-27 12:44:20 -04:00
Adam Jackson bb89fc2771 misprite: Fix software cursor on multiple ScreenRecs 2009-03-27 12:36:42 -04:00
Adam Jackson 2c000f4980 misprite: Do window check first for Get{Image,Spans} too 2009-03-27 11:54:52 -04:00
Adam Jackson 8beced6c02 misprite: RECT_IN_REGION -> miRectIn 2009-03-27 11:43:33 -04:00
Adam Jackson a232116b9e misprite: Fix a typo 2009-03-27 11:41:40 -04:00
Adam Jackson 1f0eaf886d misprite: Fix cast abuse 2009-03-27 11:29:40 -04:00
Adam Jackson 4ab93f0566 misprite: In SourceValidate, check that it's a Window first
It almost never is.  However, you have _lots_ of input devices now, and
walking them all on every Composite operation is not the cheapest thing
in the world.
2009-03-23 15:19:47 -04:00
Peter Hutterer f5409aa026 mi: remove deprecated miPointerAbsoluteCursor
Functions that don't specify the device are so last year.
2009-03-20 15:17:57 +10:00
Peter Hutterer 4cc6a96d71 input: add support for RawDeviceEvents. 2009-03-20 15:17:56 +10:00
Peter Hutterer 6fe4c28bf4 Add agressive event type checking.
Best to FatalError if a wrong event comes in. At least that forces me to fix
it really quickly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:53 +10:00
Peter Hutterer 0b2b330f6f mi: remove a bunch of useless inputInfo.pointer assignments.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-16 13:29:07 +10:00
Peter Hutterer b874a5c0aa mi: only print the "EQ overflowing" error once.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-03 07:07:30 +10:00
Peter Hutterer 36583a4996 mi: split EQ popping and event processing into two functions.
mieqProcessInputEvents() - pop an event off the EQ and pass it to
mieqProcessDeviceEvent() - process the event according to the MD/SD hierarchy.

This way, we can use mieqPDE() from Xtest, xkb, and others to post an event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer 47f136ed6f mi: change custom handlers to internal events
This should re-enable DGA, but XQuartz needs to be changed to internal events
too now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer 763848d3ab Input: change processing API to InternalEvents.
Don't pass xEvent* and count through to processing, pass a single
InternalEvent.

Custom handlers are disabled for the time being. And for extra fun,
XKB's pointer motion emulation is disabled. But stick an error in there so
that we get reminded should we forget about it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer 007e93c869 xkb: Switch the xkb event processing path over to InternalEvents.
Before dropping down into the DIX, convert back into XI events. This is a
temporary solution only, until the DIX is capable of handling InternalEvents
anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer 4026c63e4e mi: switch the EQ to contain InternalEvents only.
This gets rid of the nevents parameter, InternalEvents are always a single
item per event. Also remove the special DeviceValuator handling in both
enqueueing and dequeueing.

Custom callback handlers are now broken until fixed.

For bisectability, we copy the InternalEvent back into the XI required during
POE and friends. Consider this a temporary solution.

Note: Because of misc linker bonghits, Xvfb won't link in this revision.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Åstrand ddb8d8945d xserver: Avoid sending uninitialized padding data over the network
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-16 13:28:38 +10:00
Maarten Maathuis d591c7d1b8 mi: kill a few warnings 2009-02-07 21:58:17 +01:00
Maarten Maathuis 00226d0b58 mi: clip exposures to pGC->clientClip. 2009-02-07 21:58:17 +01:00
Maarten Maathuis 2e76958d30 fb: move some code to mi 2009-02-06 18:42:39 +01:00
Peter Hutterer 9fe9b6e4ef mi: don't call UpdateSpriteForScreen if we have Xinerama enabled. #18668
In Xinerama all windows hang off the first root window. Crossing the screens
must not reset the spriteTrace, otherwise picking fails and events are sent to
the root window.

X.Org Bug 18668 <http://bugs.freedesktop.org/show_bug.cgi?id=18668>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-04 09:01:27 +10:00
Adam Jackson 132b464d73 Remove a bunch of useless casts.
We've had void * for twenty years now people let's try to act like we
know how it works.
2009-01-22 02:11:16 -05:00
Daniel Stone 40877c6680 XKB: Make XKB mandatory
No more #ifdef XKB, because you can't disable the build, and no more
noXkbExtension either.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:06:25 +11:00
Jeremy Huddleston ca46c01869 XQuartz: mieq: Wait for the server to finish initializing before letting other threads mieqEnqueue
Avoid possible race condition whereby one thread might call mieqEnqueue before InitAndStartDevices finishes
(cherry picked from commit 94e417ac87)
2009-01-16 13:58:20 -08:00
Peter Hutterer d645721170 mi: ensure chained button mappings from SD -> MD (#19282)
After copying the master event, flip the detail field to the mapped button of
the SD, not the physical button. This way if the SD has a mapping 1:3 and the
MD has a mapping of 3:4, a press on button 1 on the SD results in a core event
on button 4.

X.Org Bug 19282 <http://bugs.freedesktop.org/show_bug.cgi?id=19282>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-15 09:28:01 +10:00
Peter Hutterer d36adf52a2 dix: fix WarpPointer calls for devices with custom valuator ranges (#19297)
If the MD's lastSlave was a devices with custom axes ranges, then a
WarpPointer would position the cursor at the wrong location. A WarpPointer
request provides screen coordinates and these coordinates were scaled to the
device range before warping.

This patch consists of two parts:
1) in the WarpPointer handling, get the lastSlave and post the event through
   this device.
2) assume that WarpPointer coordinates are always in screen coordinates and
   scale them to device coordinates in GPE before continuing. Note that this
   breaks device-coordinate based XWarpDevicePointer calls (for which the spec
   isn't nailed down yet anyway) until a better solution is found.

X.Org Bug 19297 <http://bugs.freedesktop.org/show_bug.cgi?id=19297>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-13 09:22:56 +10:00
Jeremy Huddleston dde5c591be mieq: Avoid possible race condition whereby one thread might call mieqEnqueue before InitAndStartDevices finishes
This is more of a hack around the problem.  This is something that will need to be addressed in a
more structured manner with the multi threaded input efforts.
(cherry picked from commit 3c596c061e)
2009-01-11 16:39:20 -08:00
Jeremy Huddleston 5339c22a8c XQuartz: Add locking to make mieq thread safe on OSX
(cherry picked from commit 7a8d226686)
2009-01-11 01:56:45 -08:00
Julien Cristau 46f3c1b937 mi: don't mix declarations and code 2009-01-11 08:54:12 +01:00
Julien Cristau 5aa9483d3e mi: ANSI cleanups 2009-01-11 08:54:12 +01:00
Jeremy Huddleston a939368ab8 mi: Reuse memory in mieqProcessInputEvents rather than making excessive calls to calloc()
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2008-12-15 03:20:17 -08:00
Peter Hutterer cb95642dc8 Remove #define NEED_EVENTS and NEED_REPLIES
A grep on xorg/* revealed there's no consumer of this define.

Quote Alan Coopersmith:
"The consumer was in past versions of the headers now located
in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h,
all the event definitions were only available if NEED_EVENTS were
defined, and all the reply definitions required NEED_REPLIES.

Looks like Xproto.h dropped them by X11R6.3, which didn't have
the #ifdef's anymore, so these are truly ancient now."

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-12-12 11:43:32 +10:00
Peter Hutterer d281866b74 mi: Clean up CopyGetMasterEvent, re-use the memory.
Alloc an EventList once and then re-use instead of allocing a new event each
time we need a master event.
There's a trick included: because all the event processing handlers only take
an xEvent, init a size 1 EventList and squash the events into this one.

Events that have count > 1 must be squished into an xEvent array anyway before
passing into the event handlers, so we don't lose anything here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
2008-12-10 12:42:45 +10:00
Peter Hutterer 0b4fef6337 dix: move MAX_VALUATOR_EVENTS into include/input.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-12-10 12:42:45 +10:00
Peter Hutterer 090f631239 mi: always update the sprite for master devices.
Follow-up to 9ce995373e. This re-enables cursor rendering if the MD is
controlled through software (e.g. synergy).

Reported by John Tapsell: "I use Xorg with no mouse attached, but use synergy
to control the mouse.  The commit means that I no longer have a visible mouse
cursor.  The mouse cursor is still 'there' in terms that I can click buttons
etc with it, but it's just not visible."

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-12-10 11:06:59 +10:00
Paulo Cesar Pereira de Andrade b1dac41fb3 Use libtool convenience libraries and better "symbol" table.
All .a libraries were converted to .la, and instead of linking the
Xorg binary with a mix of .a and .la, and adding some libraries more
then once in the command line, etc, now it generates a single libxorg.la
from all the required convenience libraries, and links with a dummy
xorg.c (that should usually be the file with the main function...).
This removes the requirement of some things like libosandcommon and
libinit, that existed to circumvent problems when linking multiple
.a and .la in the final Xorg binary.

  The "symbol table" is now generated dynamically, by a shell script,
with an embedded gawk parser that parses cpp output. The new file
sdksyms.sh is generated by hand by analyzing all Makefile.am's and
making it create a sdksyms.c file, that includes all sdk headers that
will add symbols for the Xorg binary. Module headers aren't read, and
a in 2 files it was required to add a "<hash>ifndef XorgLoader" around
declarations shared between the Xorg binary and libextmod. A few
other changes were added to other sdk headers, like preventing
multiple inclusion, or including other headers to satisfy dependencies.

  This should be a lot more portable, and better (hopefully properly)
using libtool to generate convenience libraries.
2008-12-07 02:22:19 -02:00
Paulo Cesar Pereira de Andrade 49f77fff14 Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.

  This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)

  LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.

  xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 05:43:34 -02:00
Peter Hutterer 9ce995373e mi: UpdateSprite only if the device is attached. 2008-12-02 15:50:38 +10:00
Paulo Cesar Pereira de Andrade fb22d4d928 Remove declarations of symbols that are never defined.
These symbols were removed from the X Server, or never declared.
  One symbol that may need special attention is XkbBuildCoreState(),
that doesn't have a prototype anywhere, but is called from
xkb/xkbEvents.c:XkbFilterEvents(), and also used by the macros
XkbStateFieldFromRec() and XkbGrabStateFromRec() defined in
include/xkbstr.h.
  fb/wfbrename.h also may need some cleanup, as it makes several
"renames" of non existing symbols.
2008-11-30 01:33:20 -02:00
Paulo Cesar Pereira de Andrade d6cbd4511e Export symbols defined in the sdk.
This is the biggest "visibility" patch. Instead of doing a "export"
symbol on demand, export everything in the sdk, so that if some module
fails due to an unresolved symbol, it is because it is using a symbol
not in the sdk.

  Most exported symbols shouldn't really be made visible, neither
advertised in the sdk, as they are only used by a single shared object.

  Symbols in the sdk (or referenced in sdk macros), but not defined
anywhere include:
XkbBuildCoreState()
XkbInitialMap
XkbXIUnsupported
XkbCheckActionVMods()
XkbSendCompatNotify()
XkbDDXFakePointerButton()
XkbDDXApplyConfig()
_XkbStrCaseCmp()
_XkbErrMessages[]
_XkbErrCode
_XkbErrLocation
_XkbErrData
XkbAccessXDetailText()
XkbNKNDetailMaskText()
XkbLookupGroupAndLevel()
XkbInitAtoms()
XkbGetOrderedDrawables()
XkbFreeOrderedDrawables()
XkbConvertXkbComponents()
XkbWriteXKBSemantics()
XkbWriteXKBLayout()
XkbWriteXKBKeymap()
XkbWriteXKBFile()
XkbWriteCFile()
XkbWriteXKMFile()
XkbWriteToServer()
XkbMergeFile()
XkmFindTOCEntry()
XkmReadFileSection()
XkmReadFileSectionName()
InitExtInput()
xf86CheckButton()
xf86SwitchCoreDevice()
RamDacSetGamma()
RamDacRestoreDACValues()
xf86Bpp
xf86ConfigPix24
xf86MouseCflags[]
xf86SupportedMouseTypes[]
xf86NumMouseTypes
xf86ChangeBusIndex()
xf86EntityEnter()
xf86EntityLeave()
xf86WrapperInit()
xf86RingBell()
xf86findOptionBoolean()
xf86debugListOptions()
LoadSubModuleLocal()
LoaderSymbolLocal()
getInt10Rec()
xf86CurrentScreen
xf86ReallocatePciResources()
xf86NewSerialNumber()
xf86RandRSetInitialMode()
fbCompositeSolidMask_nx1xn
fbCompositeSolidMask_nx8888x0565C
fbCompositeSolidMask_nx8888x8888C
fbCompositeSolidMask_nx8x0565
fbCompositeSolidMask_nx8x0888
fbCompositeSolidMask_nx8x8888
fbCompositeSrc_0565x0565
fbCompositeSrc_8888x0565
fbCompositeSrc_8888x0888
fbCompositeSrc_8888x8888
fbCompositeSrcAdd_1000x1000
fbCompositeSrcAdd_8000x8000
fbCompositeSrcAdd_8888x8888
fbGeneration
fbIn
fbOver
fbOver24
fbOverlayGeneration
fbRasterizeEdges
fbRestoreAreas
fbSaveAreas
composeFunctions
VBEBuildVbeModeList()
VBECalcVbeModeIndex()
TIramdac3030CalculateMNPForClock()
shadowBufPtr
shadowFindBuf()
miRRGetScreenInfo()
RRSetScreenConfig()
RRModePruneUnused()
PixmanImageFromPicture()
extern int miPointerGetMotionEvents()
miClipPicture()
miRasterizeTriangle()
fbPush1toN()
fbInitializeBackingStore()
ddxBeforeReset()
SetupSprite()
InitSprite()
DGADeliverEvent()

  SPECIAL CASES
o defined as _X_INTERNAL
	xf86NewInputDevice()
o defined as static
	fbGCPrivateKey
	fbOverlayScreenPrivateKey
	fbScreenPrivateKey
	fbWinPrivateKey
o defined in libXfont.so, but declared in xorg/dixfont.h
	GetGlyphs()
	QueryGlyphExtents()
	QueryTextExtents()
	ParseGlyphCachingMode()
	InitGlyphCaching()
	SetGlyphCachingMode()
2008-11-29 23:56:06 -02:00
Jeremy Huddleston 19aac4274b mi: Push screen-saver/DPMS handling to after the EQ pop operation.
This way we on't need to hold the mutex during the dixSaveScreens() call.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Tiago Vignatti <vignatti@c3sl.ufpr.br>
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-19 10:55:29 -08:00
Jeremy Huddleston 56d1793c43 mi: Only increment tail (push) when the event data is actually in the queue
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Tiago Vignatti <vignatti@c3sl.ufpr.br>
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-19 10:54:57 -08:00
Peter Hutterer fc3e8bfb82 mi: clean up mieqProcessInputEvents, copy all events before processing.
Copy the EventRec's information into local variables before processing them,
this should make it safer for upcoming threading and also makes it easier to
read.

Simplify the event allocation code from the abyss it was before.

This also fixes a potential bug where a custom handler could scramble the
event before the same -now scrambled- event was then passed through the
master's custom event handler.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-11 14:52:54 +10:00
James Cloos b3c7e62664 Remove some null statements.
Remove several doubled statement-terminal semicolons.

Reported by Fernando Carrijo.
2008-11-08 12:21:20 -05:00
Julien Cristau d3d6be4948 mi: Fix infinite loop on regen when swrast_dri.so is missing
The swrast DRI provider gets pushed on the glx provider stack at every
server generation, so the stack turns into a circular list on regen.

X.Org bug#18388 <https://bugs.freedesktop.org/show_bug.cgi?id=18388>
2008-11-07 19:03:32 +01:00
Peter Hutterer cbc6f98395 xkb: when faking mouse button events, fake them on the correct devices.
When MouseKeys are activated, keyboard devices may generate fake mouse button
events through XKB. Let's get then running through the appropriate paths, i.e.
as XI events on the correct device.

To make matters more fun, ProcessOtherEvents drops events if the DIX device
state cannot be updated accordingly, i.e. all button events from keyboard
devices.
Hence we need to get the paired MD for the device in XkbDDXFakeDeviceButton,
and post the event through the paired MD (usually the VCP).

Removes now-unused ddxFakeBtn.c.

Note: this patch only half-arsedly fixed button events, motion events are a
more complicated matter.
2008-11-04 16:04:15 +10:30
Daniel Stone f4036f6ace Remove XEvIE
It's unmaintained and has been broken for quite a while; MPX finally
smashed it completely.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-04 16:01:07 +10:30
Daniel Stone 889a8dc02b Xi: XINPUT has been mandatory for ages
Ditch all #ifdef XINPUT, since it's always built.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-04 16:01:07 +10:30
Julien Cristau 4b96ba8ddf Nuke unused miBankNewSerialNumber 2008-10-26 11:56:35 +01:00
Julien Cristau 30a7a06a9e Nuke prototype for nonexistent function
miDoInitVisuals was removed in commit
94825ad3c7, but its prototype was left.
2008-10-26 11:44:57 +01:00
Adam Jackson b736f477f5 mieq: Backtrace when the queue overflows.
Since we're probably stuck down in a driver somewhere, let's at least
try to point out where.  This will need to be rethought when the input
thread work lands though.
2008-10-10 16:33:57 -04:00
Tiago Vignatti d1bb5e3b47 mi: functions here are carrying 'time' without need. 2008-10-08 03:41:17 -03:00
Tiago Vignatti 4964a9ca6c mi: remove deprecated and unused functions.
miPointerDeltaCursor, miPointerGetMotionBufferSize and
miPointerSetNewScreen.
2008-10-08 03:41:17 -03:00
Adam Jackson 0b7b89fbac xalloc+bzero -> xcalloc 2008-10-06 14:19:30 -04:00
Adam Jackson b72a217ad5 Dangling use of miDestroyGCOps 2008-10-03 18:30:37 -04:00
Adam Jackson f5bbc54a93 Fix compile for miSetScreenPixmap prototype. 2008-10-03 18:18:02 -04:00
Adam Jackson 9dbfcd8921 Delete unused miModifyBanking() 2008-10-03 17:51:21 -04:00
Adam Jackson 94825ad3c7 Remove unused wrapping for visual initialization. 2008-10-03 17:51:21 -04:00
Adam Jackson 4791f8e2ba staticize mi{G,S}etScreenPixmap 2008-10-03 17:51:20 -04:00
Adam Jackson 14d98b4a2f miFindMaxBand is dead code 2008-10-03 17:51:20 -04:00
Adam Jackson 48b4792813 mi{Create,Destroy}GCOps are unused, nuke 'em. 2008-10-03 17:51:20 -04:00
Adam Jackson bd0e87c747 Remove a bunch of unused API from the mi export list. 2008-10-03 17:51:20 -04:00
Adam Jackson 0ce61e21d6 Remove the Must_have_memory hack.
Also remove an astonishing amount of misunderstanding of how casts work.
2008-10-03 17:51:19 -04:00
Jeremy Huddleston dac9e91870 mieq: Made custom event handlers safer for nevents >1 2008-09-21 17:33:04 -07:00
Keith Packard 03ab8f11d2 When resizing a window with redirected descendents, don't expose them
Bit/window gravity computations need to recompute exposures to manage the
bits which are saved by gravity during the resize computation. That's easy
for non-redirected windows where the bits are all within the parent's
pixmap. For redirected windows, we don't need to deal with this at all, so
just skip the whole re-computation adventure.

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-09-19 20:59:40 -07:00
Jeremy Huddleston 47bf269d59 mieq: Fix my broken cherry pick. 2008-09-03 12:54:56 -07:00
Jeremy Huddleston 9e70a3cf58 mieqProcessInputEvents: Check custom event handlers first. 2008-09-03 09:33:39 -07:00
Tomas Carnecky ebea78cdba Prepare for array-index based devPrivates.
TODO: static indices can be made just an int; some indices
can be combined.
2008-08-28 18:05:40 -04:00
Eamon Walsh ec7907f8fa Add an array of integers for use as per-screen cursor private keys.
Replaces the use of the screen pointer itself as the key, which was
nice but won't work now that an array index is being stored.
2008-08-27 19:27:13 -04:00
Adam Jackson af5125968a Refactor misprite a bit.
No variable declarations in header files, please.
2008-08-19 14:47:10 -04:00
Fredrik Höglund 244a635fcd Fix the tile offset in miPaintWindow for ParentRelative windows. 2008-08-18 19:27:34 +02:00
Adam Jackson 0ce687634f Eviscerate save-under support.
Use a compositing manager already.  Plus I really wanted to use 'eviscerate'
in a commit message.
2008-08-13 17:28:08 -04:00
Adam Jackson 63bdd4c27d Unifdef XIDLE.
Seriously how was this still here.
2008-07-31 17:31:36 -04:00
Adam Jackson f3ff238601 Sync is built-in and mandatory. 2008-07-24 15:46:08 -04:00
Adam Jackson 3fcf4d3eb8 XC-MISC is built-in and mandatory. 2008-07-24 15:46:08 -04:00
Adam Jackson f65c50c4e9 Bigreqs are built-in and mandatory. 2008-07-24 15:46:08 -04:00
Adam Jackson d6228cb22a Shape extension is built-in and mandatory. 2008-07-24 15:46:08 -04:00
Adam Jackson 856db05b58 Unifdef sgi. 2008-07-23 13:37:42 -04:00
Adam Jackson 0ff5bc4048 Unifdef QNX.
Again, hasn't worked since at least 7.0.
2008-07-23 10:44:34 -04:00
Adam Jackson 0b45ba488d Drop the FONTCACHE extension.
This appears to have been dead code since X-TT was merged.
2008-07-18 10:54:10 -04:00
Daniel Stone 55644d2f1c Make --enable-debug usable again
Enable region debugging causes assertion failures (should really look
into that, though), and I don't need four messages every time I move my
pointer.
2008-07-16 14:23:34 +03:00
Daniel Stone 22e64108ec XFree86: Remove XFree86-Misc extension
Its last remaining purpose in life has been destroyed by input
properties.  Au revoir: it's been fun, by which I mean awful.
2008-07-16 06:25:26 +03:00
Tiago Vignatti d78bebb20a Remove unused function and variables. 2008-07-04 04:04:19 -03:00
Tiago Vignatti 3164288b12 Remove deprecated function miPointerPosition(). 2008-07-04 03:55:59 -03:00
Adam Jackson cbc20d92de XTrap delenda est. 2008-06-25 09:52:36 -04:00
Adam Jackson 9719354ae0 Check for __amd64__, not __x86_64__.
Spiritual revert of 1fa4de80fc.  Intel's C
compiler claims to be gcc-compatible; if they're not defining the same
macros as gcc then that's their bug, not ours.  Even if we were to do
this aliasing we should do it once and for all in servermd.h.
2008-06-24 14:37:06 -04:00
Peter Hutterer 4f3ed54dc9 mi: remove trailing whitespaces from misprite.c 2008-06-18 10:07:37 +09:30
Eamon Walsh 9d871e19c9 Fix "warning: unused variable ‘pDev’, `pPointer'". 2008-06-13 21:35:29 -04:00
Tiago Vignatti 881e551de9 CopyGetMasterEvent() can be static. 2008-06-11 18:03:33 -03:00
Tiago Vignatti 656949cbe2 Remove more unused things.
In function ‘miSpriteCloseScreen’:
    warning: unused variable ‘pDev’
2008-06-11 17:57:19 -03:00
Peter Hutterer ea6a02c048 mi: protect mipointrst.h against multiple includes. 2008-06-11 17:24:19 +09:30
Peter Hutterer a7d4bec884 mi: remove leftover old license comment. 2008-06-08 23:28:28 +09:30
Julien Cristau 782394fe53 mi: Fix typo in comments about deprecated functions 2008-06-06 12:10:35 +02:00
Peter Hutterer d25ffcfbfc mi: protect against possible NULL-pointer dereference. 2008-06-05 16:14:34 +09:30
Paulo Cesar Pereira de Andrade 8644aa4717 mi: minor build fix when compiling with debug enabled.
Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-06-05 08:55:09 +09:30
Peter Hutterer 58d12c99ab mi: Remove #ifdef XINPUT, kdrive otherwise won't get events. 2008-05-31 18:45:11 +09:30
Peter Hutterer 341a61b608 mi: reduce noisyness. DebugF is enough if device ID can't be changed.
Also - printing out the event type is actually helpful.
2008-05-31 17:42:05 +09:30
Peter Hutterer 9b544fa400 mi: ansify. 2008-05-28 14:23:08 +09:30
Peter Hutterer 26c1958c32 Merge branch 'master' into mpx 2008-05-26 17:37:31 +09:30
Peter Hutterer e0fbe404a4 mi: handle sprite even for floating slave devices.
We still don't render it, but we accept all the other calls to update it's
internal state.
2008-05-22 23:24:29 +09:30
Kristian Høgsberg 77ff8fd507 Drop glcore GLX provider.
Obsoleted by the DRI swrast driver.
2008-05-21 12:15:18 -04:00
George Sapountzis 255142b61e drop xprint remnants: InitGlobals 2008-05-21 18:13:09 +03:00
Peter Hutterer 7509fb498c Merge branch 'hwcursor' into mpx 2008-05-21 16:25:35 +09:30
Peter Hutterer 2ae3bed337 mi: shut up compiler warning (return w/o a value) 2008-05-21 15:51:35 +09:30
George Sapountzis 6ff6465931 Add loader for the swrast dri driver. 2008-05-20 16:38:05 -04:00
Peter Hutterer f9edecd1b5 mi: sync declaration and definition of mieqResizeEvents. 2008-05-20 11:07:17 +09:30
Peter Hutterer 99d28c3ef3 Merge branch 'master' into mpx
Conflicts:

	Xext/xprint.c (removed in master)
	config/hal.c
	dix/main.c
	hw/kdrive/ati/ati_cursor.c (removed in master)
	hw/kdrive/i810/i810_cursor.c (removed in master)
	hw/xprint/ddxInit.c (removed in master)
	xkb/ddxLoad.c
2008-05-20 10:20:14 +09:30