summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-06-10xfree86: Match devices based on current driver settinginputconfDan Nicholson5-22/+57
Often we want to apply a driver specific option to a set of devices and don't care how the driver was selected for that device. The MatchDriver entry can be used to match the current driver string: MatchDriver "evdev|mouse" Option "Emulate3Buttons" "yes" The driver string is a case sensitive match. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-06-10xfree86: Allow multiple InputClass Match* entries for && matchingDan Nicholson4-109/+179
Currently when there multiple InputClass entries of the same type, only the last entry is used and the previous ones are ignored. Instead, multiple entries are used to create multiple matching conditions. For instance, an InputClass with MatchProduct "foo" MatchProduct "bar" will require that the device's product name contain both foo and bar. This provides a complement to the || style matching when an entry is split using the "|" token. The xorg.conf man page has added an example to hopefully clarify the two types of compound matches. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-06-10config: Script to convert HAL fdi settings to InputClass sectionsDan Nicholson2-1/+203
In the new world of udev and InputClass, x11_* settings from HAL fdi files will not be honored. This script converts those settings into valid InputClass sections that can be dropped into xorg.conf.d. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-06-10xfree86: Match devices based on USB IDDan Nicholson10-0/+88
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>
2010-06-10xfree86: Match devices based on PnP IDDan Nicholson10-1/+68
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>
2010-06-10xfree86: Add MatchOS InputClass entry for operating system matchingDan Nicholson7-1/+66
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>
2010-06-10xfree86: Refactor InputClass matching codeDan Nicholson1-51/+66
InputClassMatches was starting to get a little hairy with all the loops over the tokenized match strings. This adds code, but makes it easier to read and add new matches. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-10xfree86: Constify InputClass functionsDan Nicholson1-3/+4
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-06-10config/hal: Missing newline in log messageDan Nicholson1-1/+1
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-10config/udev: Add verbose info when fetching udev propertiesDan Nicholson1-3/+36
Give the user a chance to see why their input devices are being ignored, even if they have to start the server with -logverbose. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-10config/hal: don't leak the input.tags propertyDan Nicholson1-1/+4
Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-07If XTest is always required, then eliminate the XTest devPrivateKeith Packard5-30/+9
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-07dri2: Deal with input-only windows by using WindowDrawable()Keith Packard1-5/+5
Input only windows aren't DRAWABLE_WINDOW, but casting them to a PixmapPtr is a bit harsh, and unlikely to get the appropriate privates structure. use WindowDrawable instead which checks for both input-output and input-only windows. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Eric Anholt <eric@anholt.net>
2010-06-06Initialize private keys in test suiteKeith Packard7-4/+31
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-06Place glyph privates at correct location within the allocate storageKeith Packard1-5/+5
A glyph allocation consists of : GlyphRec numScreens * PicturePtr glyph privates Tell the dix private bits to start past the picture pointers. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-06randr: Make deletion of output properties more robustMikhail Gusarov1-41/+35
Previously there was two branches of code with small discrepancies between them (especially prop->valid_values field was not free(3)ed). Extract the common routine and fix double-free prop->valid_values in RRDestroyOutputProperty by the way. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-06Remove more superfluous if(p) checks around free(p)Mikhail Gusarov84-412/+240
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ -if(E) { free(E); } +free(E); Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-06Replace deprecated bzero with memsetMikhail Gusarov32-132/+132
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-06xkb: Remove superfluous if(x) x = realloc(x, sz); else x = malloc(sz); logicMikhail Gusarov1-71/+23
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Marcin Baczyński <marbacz@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-06-06xkb: Remove superfluous if(p) checks around free(p)Mikhail Gusarov1-96/+48
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-06-05Merge remote branch 'jamey/for-keith'Keith Packard7-1/+147
2010-06-05dmx: Split glx scalar swap variables from array swap variables.Jamey Sharp7-1/+147
This makes hw/dmx/glxProxy/unpack.h more closely resemble glx/unpack.h, and fixes the "unused variable 'swapEnd'" and "unused variable 'swapPC'" warnings. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05dix: Remove test for obsolete NO_XINERAMA_PORT macro.Kim Woelders1-2/+1
Signed-off-by: Kim Woelders <kim@woelders.dk> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Clean up after removal of screen parameters from region macros.Jamey Sharp31-259/+102
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05Damage pixmap private key was being mis-registered as a picture keyKeith Packard1-1/+1
This would cause all kinds of fun, in particular Xnest would crash at startup. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Register Xnest colormap screen private keyKeith Packard1-0/+3
This key is used to store the currently installed colormap and must be registered before we can use it. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Make GetPictureScreenIfSet check if Render is runningKeith Packard1-1/+1
This macro originally checked to see if the Render screen private index had been allocated. When the privates were changed the first time, there wasn't any need to check as dixLookupPrivate would simply return NULL in that case. Now that we care, check to see if the key has been initialized before asking for the value. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Move the shadow screen private key initialization to shadowSetupKeith Packard1-3/+3
Some users of the shadow code don't call shadowInit, just shadowSetup and so make sure the key is initialized there. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Fix exa_priv.h declarations of privatesKeith Packard2-9/+10
exa_priv.h exposes the privates to the rest of the exa code, and yet the declarations of the privates wasn't fixed when the exa.c versions were. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05kdrive: Xv code uses shared screen private instead of kdrive-specific privateKeith Packard1-5/+1
When doing the devPrivate API conversion, I missed this as there was also a local private key which wasn't ever used. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Allocate per-screen device/cursor-bits private keys in midispcurKeith Packard1-15/+14
midispcur was abusing the CursorScreenKey to index the cursor_bits privates, it also had a MAXSCREENS array of keys to index device privates. Switch both of these to the new dixCreatePrivateKey API and store a pointer to that in the screen private. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-05Add dixCreatePrivateKey APIKeith Packard2-2/+42
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 Packard2-185/+407
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 Packard139-711/+1105
This patch only changes the API, not the implementation of the devPrivates infrastructure. This will permit a new devPrivates implementation to be layed into the server without requiring simultaneous changes in every devPrivates user. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-05Create separate private key for midispcur cursor bitsKeith Packard1-17/+21
The CursorScreenKey array is supposed to be used by the DDX for cursor private data, but midispcur was abusing it to hold cursor bits private information. Create a separate set of privates for the dispcur cursor bits information. This also renames the device private index and macros to better reflect their usage: miDCSpriteKey -> miDCDeviceKey MIDCBUFFER -> miGetDCDevice Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-05Remove dixRegisterPrivateOffset; hard-code devPrivates offsets insteadKeith Packard4-63/+19
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 Packard4-276/+196
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 Packard130-1865/+1817
This is a combination of a huge mechanical patch and a few small fixups required to finish the job. They were reviewed separately, but because the server does not build without both pieces, I've merged them together at this time. The mechanical changes were performed by running the included 'fix-region' script over the whole tree: $ git ls-files | grep -v '^fix-' | xargs ./fix-region And then, the white space errors in the resulting patch were fixed using the provided fix-patch-whitespace script. $ sh ./fix-patch-whitespace Thanks to Jamey Sharp for the mighty fine sed-generating sed script. The hand-done changes involve removing functions from dix/region.c that duplicate inline functions in include/regionstr.h, along with their declarations in regionstr.h, mi.h and mispans.h. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Move mi/miregion.c to dix/region.cKeith Packard3-1/+1
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 Packard10-149/+192
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-05rootless: Fix SetShape regressionJeremy Huddleston2-3/+3
This fixes a regression in miext/rootless from 643cb6e87c10ab554c03ada81930001a8ebcc909 Found-by: tinderbox Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-04configure: Check for libsha1.pcPauli Nieminen1-1/+1
xserver fails to detect libsha1. Problem is that configure checks for sha1.pc when libsha1 provides libsha1.pc. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-04Stop searching for XF86Config filesAlan Coopersmith1-5/+1
xorg.conf has been used since the X11R6.7 release in April 2004. 6 years has been a generous transition period for users to "mv XF86Config xorg.conf" and for distros to update their configuration tools and packages. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: James Cloos <cloos@jhcloos.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-04Stop searching for XF86Config filesAlan Coopersmith2-18/+10
xorg.conf has been used since the X11R6.7 release in April 2004. 6 years has been a generous transition period for users to "mv XF86Config xorg.conf" and for distros to update their configuration tools and packages. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: James Cloos <cloos@jhcloos.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-04xkb: fix invalid memory writes in _XkbCopyGeom.Peter Hutterer1-2/+2
Classic strlen/strcpy mistake of foo = malloc(strlen(bar)); strcpy(foo, bar); Testcase: valgrind Xephyr :1 ==8591== Invalid write of size 1 ==8591== at 0x4A0638F: strcpy (mc_replace_strmem.c:311) ==8591== by 0x605593: _XkbCopyGeom (xkbUtils.c:1994) ==8591== by 0x605973: XkbCopyKeymap (xkbUtils.c:2118) ==8591== by 0x6122B3: InitKeyboardDeviceStruct (xkbInit.c:560) ==8591== by 0x4472E2: CoreKeyboardProc (devices.c:577) ==8591== by 0x447162: ActivateDevice (devices.c:530) ==8591== by 0x4475D6: InitCoreDevices (devices.c:672) ==8591== by 0x4449EE: main (main.c:254) ==8591== Address 0x6f96505 is 0 bytes after a block of size 53 alloc'd ==8591== at 0x4A0515D: malloc (vg_replace_malloc.c:195) ==8591== by 0x6054B7: _XkbCopyGeom (xkbUtils.c:1980) ==8591== by 0x605973: XkbCopyKeymap (xkbUtils.c:2118) ==8591== by 0x6122B3: InitKeyboardDeviceStruct (xkbInit.c:560) ==8591== by 0x4472E2: CoreKeyboardProc (devices.c:577) ==8591== by 0x447162: ActivateDevice (devices.c:530) ==8591== by 0x4475D6: InitCoreDevices (devices.c:672) ==8591== by 0x4449EE: main (main.c:254) Reported-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by-and-apologised-for: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-03composite: use config notify hook to do pixmap resize.Dave Airlie6-158/+70
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-03Merge remote branch 'jamey/for-keith'Keith Packard73-957/+597
2010-06-03Accumulate graphics exposures incrementally in PanoramiXCopyArea/Plane.Jamey Sharp1-36/+26
This fuses two loops in each function, eliminating an intermediate MAXSCREENS-sized array from each. Aside from being more efficient, I believe this is equivalent to the previous implementation, since - each per-screen GC has the graphicsExposures flag set the same way, and - the REGION_* macros ignore their screen argument. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03Delete XineramaScreenRegions cache.Jamey Sharp2-19/+21
Every screen region consists of a single rectangle, so initializing a stack-allocated region for each screen on-demand does no heap allocation and is fast. This eliminates a MAXSCREENS-sized array. The REGION_UNINIT calls are no-ops since no boxes are actually allocated for a single-rectangle region, but it seemed wiser to include them. 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)