summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2010-06-10Merge remote branch 'whot/for-keith'Keith Packard2-0/+5
2010-06-11xfree86: Match devices based on USB IDDan Nicholson1-0/+1
Sometimes the vendor and product names aren't specific enough to target a USB device, so expose the numeric codes in the ID. A MatchUSBID entry has been added that supports shell pattern matching when fnmatch(3) is available. For example: MatchUSBID "046d:*" The IDs are stored in lowercase hex separated by a ':' like "lsusb" or "lspci -n". Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-11xfree86: Match devices based on PnP IDDan Nicholson1-0/+1
Serial input devices lack properties such as product or vendor name. This makes matching InputClass sections difficult. Add a MatchPnPID entry to test against the PnP ID of the device. The entry supports a shell pattern match on platforms that support fnmatch(3). For example: MatchPnPID "WACf*" A match type for non-path pattern matching, match_pattern, has been added. The difference between this and match_path_pattern is the FNM_PATHNAME flag in fnmatch(3). Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-10Remove unnecessary parentheses around return values in functionsMikhail Gusarov1-2/+2
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-10xfree86: Add MatchOS InputClass entry for operating system matchingDan Nicholson1-0/+3
Allow InputClass sections to match against the running operating system to narrow the application of rules. An example where this could be used is to specify that the default input driver on Linux is evdev while it's mouse/kbd everywhere else. The operating system name is the same as `uname -s`, and matching is case-insensitive. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-07If XTest is always required, then eliminate the XTest devPrivateKeith Packard2-1/+3
The internals of XTest are used by Xi and Xkb, and both Xi and Xkb are always required, so it makes little sense to have XTest place data in a devPrivate, especially a devPrivate which is only available when the XTest extension is enabled. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-06Initialize private keys in test suiteKeith Packard2-0/+3
Make sure all of the private keys used by the test code are initialized before being used. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Robert Hooker <sarvatt@ubuntu.com>
2010-06-05Add dixCreatePrivateKey APIKeith Packard1-0/+12
Keys need to persist through server reset so that the private system can be cleaned up in dixResetPrivates. In particular, this means that keys cannot live in objects freed at reset time. This API provides suitable object lifetime by having the privates code free the key in the reset path. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-05Change devPrivates implementation.Keith Packard1-36/+80
Each key now declares which object type it belongs to, this permits keys for different types to share the same offset within the allocated privates. As a special case for XSELinux, a key may be allocated as PRIVATE_XSELINUX which will allow it to continue to be used across the relevant object types. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-05Change the devPrivates API to require dixRegisterPrivateKeyKeith Packard5-54/+150
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-05Remove dixRegisterPrivateOffset; hard-code devPrivates offsets insteadKeith Packard1-14/+4
For predefined resource types, the offset of the devPrivates field was already kept in a constant table. The only non-predefined type needing this treatment was dbeDrawableResType, which is just a magic alias for RT_PIXMAP. This patch special-cases looking up RC_DRAWABLE offsets and uses the table directly for everything else. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-05Add REGION_ macros for source compatibility with existing drivers.Keith Packard1-0/+39
This makes the region code changes source compatible with existing code, although none of them are used within the server source itself. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Change region implementation from macros to inline functions.Keith Packard2-145/+192
This makes all of the previous macros into inline functions and also turns all of the direct calls to pixman region code into inline functions as well. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Rename region macros to eliminate screen argumentKeith Packard1-63/+58
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-05Change region implementation names to eliminate the 'mi' prefixKeith Packard1-46/+46
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-03composite: use config notify hook to do pixmap resize.Dave Airlie1-1/+1
Since reallocating the backing pixmap can fail, we need to try and do it before any other side effects of reconfiguring the window happen. This changes the ConfigNotify hook to return status, and moves the composite window reconfiguration wrappers to ConfigNotify. They all basically did the same thing, so we can drop the MoveWindow, ResizeWindow, ChangeBorderWidth wrappers, and allow ConfigNotify to do all the work. If reallocation fails we fail before we send any confiureNotify events, or enter the area we can't recover from. The only place we now enforce 32k limits are in EXA/UXA/fb, so drivers that don't use this should probably deal with it in their pixmap allocate if they don't already. This also breaks ABI, so we need an alternate fix for older servers, working on the X server makes me realise why I'm a kernel hacker. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-03Move each screen's x/y origin into ScreenRec.Jamey Sharp2-3/+1
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-03Move each screen's root-window pointer into ScreenRec.Jamey Sharp2-1/+1
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 Sharp2-11/+13
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-03DRI2: Allow building without libdrmTiago Vignatti1-0/+3
Some drivers use DRI protocol but implement their own kernel rendering manager. For these drivers, libdrm becomes useless. --disable-libdrm configure parameter can be used to disable libdrm support in dri2. To provide ABI/API compatibility for libdrm based drivers, libdrm call is wrapped in ifdef. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-06-02Only deal with input code when changing the input shape.Pierre-Loup A. Griffais1-1/+2
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-28dix: add 3x3 transformation matrix xinput property for multi-head handlingPeter Korsgaard2-0/+11
For absolute input devices (E.G. touchscreens) in multi-head setups, we need a way to bind the device to an randr output. This adds the infrastructure to the server to allow us to do so. positionSprite() scales input coordinates to the dimensions of the shared (total) screen frame buffer, so to restrict motion to an output we need to scale/rotate/translate device coordinates to a subset of the frame buffer before passing them on to positionSprite. This is done here using a 3x3 transformation matrix, which is applied to the device coordinates using homogeneous coordinates, E.G.: [ c0 c1 c2 ] [ x ] [ c3 c4 c5 ] * [ y ] [ c6 c7 c8 ] [ 1 ] Notice: As input devices have varying input ranges, the coordinates are first scaled to the [0..1] range for generality, and afterwards scaled back up. E.G. for a dual head setup (using same resolution) next to each other, you would want to scale the X coordinates of the touchscreen connected to the both heads by 50%, and translate (offset) the coordinates of the rightmost head by 50%, or in matrix form: left: right: [ 0.5 0 0 ] [ 0.5 0 0.5 ] [ 0 1 0 ] [ 0 1 0 ] [ 0 0 1 ] [ 0 0 0 ] Which can be done using xinput: xinput set-prop <left> --type=float "Coordinate Transformation Matrix" \ 0.5 0 0 0 1 0 0 0 1 xinput set-prop <right> --type=float "Coordinate Transformation Matrix" \ 0.5 0 0.5 0 1 0 0 0 1 Likewise more complication setups involving more heads, rotation or different resolution can be handled. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-26Revert "Add a "flags" field to DeleteInputDeviceRequest."Keith Packard1-5/+1
Peter wants to get a larger patch sequence put together and I didn't read past the commit message to see the 'don't take this patch please'. This reverts commit 531ff40301975519af7b20109c17d296312d3f2b.
2010-05-25Add a "flags" field to DeleteInputDeviceRequest.Peter Hutterer1-1/+5
Some input drivers need to implement an internal hotplugging scheme for dependent devices to provide multiple X devices off one kernel device file. Such dependent devices can be added with NewInputDeviceRequest() but they are not removed when the config backend calls DeleteInputDeviceRequest(), leaving the original device to clean up. Example of the wacom driver: config/udev calls NewInputDeviceRequest("stylus") wacom PreInit calls NewInputDeviceRequest("eraser") NewInputDeviceRequest("pad") NewInputDeviceRequest("cursor") PreInit finishes. When the device is removed, the config backend only calls DeleteInputDeviceRequest for "stylus". The driver needs to call DeleteInputDeviceRequest for the dependent devices eraser, pad and cursor to clean up properly. However, when the server terminates, DeleteInputDeviceRequest is called for all devices - the driver must not remove the dependent devices to avoid double-frees. There is no method for the driver to detect why a device is being removed, leading to elaborate guesswork and some amount of wishful thinking. Though the input driver's UnInit already supports flags, they are unused. This patch uses the flags to supply information where the DeleteInputDeviceRequest request originates from, allowing a driver to selectively call DeleteInputDeviceRequest when necessary. Also bumps XINPUT ABI. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-25dix: add helper functions to duplicate and free InputAttributes.Peter Hutterer1-0/+2
No special memory handling is used to give drivers the maximum flexibility with the data. Drivers should be able to call realloc on the product string if needed and perform similar operations. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-22Declare functions that unconditionally call FatalError as _X_NORETURN.Jamey Sharp3-3/+3
For AtomError, this should fix a clang warning; in the other cases it's just good documentation. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-20Replace screen->rgf scratch GC flags with a bit in each GC.Jamey Sharp2-2/+2
This eliminates a poorly-named, poorly-documented field from the ScreenRec, using a previously-unused flag bit in each GC instead. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-19Merge remote branch 'vignatti/animcursor-state-fix'Keith Packard1-0/+8
2010-05-19Add typed resource-lookup errors for non-core resource types.Jamey Sharp1-0/+3
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19render: set anim cursor state for pointer enabled devices onlyTiago Vignatti1-0/+8
The structure containing the state of animated cursor was amended within SpriteInfoRec, removing all previously privates logic to keep such state. API change: It was removed MAXDEVICES dependency \o/ Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-14scrnintstr.h: removed unused PaintWindow function pointers.Oliver McFadden1-10/+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-14mi: removed unused PointerNonInterestBox functions.Oliver McFadden1-6/+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-13Merge remote branch 'jamey/cleanups'Keith Packard3-4/+13
2010-05-13Quit using clientErrorValue in dix/colormap.c.Jamey Sharp1-2/+4
And that's it! No more clientErrorValue kludge. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Define GCAllBits as the union of all valid CreateGC masks.Jamey Sharp1-0/+2
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Replace dixChangeGC with calls directly to the right variant.Jamey Sharp1-2/+7
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Remove devPrivates init and delete callback lists.Keith Packard1-27/+1
XSELinux was the only consumer of these interfaces and it no longer needs them. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-05-13Use _X_ATTRIBUTE_PRINTF _X_DEPRECATED _X_NORETURNJeremy Huddleston3-37/+17
Use the values from xproto rather than duplicating the effort Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-12Kill ChangeGC in favor of dixChangeGC.Jamey Sharp1-5/+0
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 Sharp1-6/+0
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-12Merge remote branch 'dottedmag/for-keithp'Keith Packard2-5/+8
2010-05-13Mark OsAbort as noreturn function to make gcc happier.Mikhail Gusarov1-1/+1
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13Introduce X_NORETURN macro defined as __attribute__((noreturn)) for gccMikhail Gusarov2-4/+7
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-12SetFontPath: set client->errorValue on failure.Jamey Sharp1-2/+1
Previously the callers were only setting errorValue on Success, when it's ignored, and leaving it alone on failure, when it's sent to the client. Since SetFontPath takes the ClientPtr, let it set client->errorValue instead of letting the callers continue to get it wrong. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov1-2/+2
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-13Deprecate allocation functions which are plain wrappers for C stdlibMikhail Gusarov1-4/+5
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13Document allocation functions, noting deviations from C libraryMikhail Gusarov1-0/+36
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13Clean {X,XNF}{alloc,calloc,realloc,free,strdup} from pre-C89 baggageMikhail Gusarov1-7/+7
C89 guarantees alignment of pointers returned from malloc/calloc/realloc, so stop fiddling with alignment manually and just pass the arguments to library functions. Also convert silent error when negative size is passed into function into warning in log file. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-11list.h: Add list_for_each_entry_safe()Kristian Høgsberg1-0/+6
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-07Introduce dixLookupFontable for "FONT or GC" parameters.Jamey Sharp1-0/+6
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>