Commit Graph

9403 Commits

Author SHA1 Message Date
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
431781a921 Remove dixRegisterPrivateOffset; hard-code devPrivates offsets instead
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-05 19:11:32 -07:00
Keith Packard
7ef612de78 Add REGION_ macros for source compatibility with existing drivers.
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-05 19:03:22 -07:00
Keith Packard
965cade6ee Change region implementation from macros to inline functions.
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-05 19:03:22 -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
Jeremy Huddleston
1768e51976 rootless: Fix SetShape regression
This fixes a regression in miext/rootless from 643cb6e87c

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-05 17:13:34 -07:00
Pauli Nieminen
6b4af3b792 configure: Check for libsha1.pc
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-04 09:47:54 -07:00
Alan Coopersmith
d163266692 Stop searching for XF86Config files
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-04 00:23:11 -07:00
Alan Coopersmith
01c75522b6 Stop searching for XF86Config files
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-04 00:22:54 -07:00
Peter Hutterer
7f19a7a6e9 xkb: fix invalid memory writes in _XkbCopyGeom.
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-04 00:20:53 -07:00
Dave Airlie
959a1eaf1c composite: use config notify hook to do pixmap resize.
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-03 21:26:24 -07:00
Keith Packard
0f12e86e60 Merge remote branch 'jamey/for-keith' 2010-06-03 15:09:32 -07:00
Jamey Sharp
f114f54986 Accumulate graphics exposures incrementally in PanoramiXCopyArea/Plane.
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-03 14:04:20 -07:00
Jamey Sharp
a7c7ebe4b3 Delete XineramaScreenRegions cache.
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)
2010-06-03 14:03:23 -07:00
Jamey Sharp
a0456da339 XineramaSetCursorPosition: use screen bounds directly, not POINT_IN_REGION.
This hides a MAXSCREENS-sized array as an implementation detail of
panoramiX.c rather than an exported global.

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
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
Jamey Sharp
d1bad1b59f dmx: Fix XSetExtensionErrorHandler calls to agree on constness.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-03 14:03:22 -07:00
Alan Coopersmith
aa7c09f7d0 Install fbdevhw module in normal module directory instead of linux/
Since we no longer support OS-independent custom elfloader modules,
we don't need to put the OS-dependent modules into os-specific subdirs
any more.

We do however still need to install the stubs version of this module
on non-Linux platforms, since a number of drivers link to functions
in it, even when built on non-Linux platforms.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-03 07:29:50 -07:00
Keith Packard
b13d7a8e09 Merge remote branch 'vignatti/for-keith' 2010-06-03 07:01:26 -07:00
Tiago Vignatti
dcceb90b1d xext: delete wrong source reference from fontcache
This should go away in 0b45ba48.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-06-03 15:55:59 +03:00
Tiago Vignatti
c043de3261 configure: sha1: check libsha1 using pkg-config instead
Previously the code was using AC_CHECK_LIB, guaranteeing whether the library
is correct by tracking sha1_begin function. This paranoic checking is not
necessary given there's only one libsha1 in the market, which surely contains
such function.

Moreover, this patch now improves a bit the sha1 implementation checking
behavior using pkg-config to find the right flags that needs to link against.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-06-03 15:51:30 +03:00
Pauli Nieminen
f0ab726d89 DRI2: Use single error path in initialization
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-06-03 11:56:56 +03:00
Tiago Vignatti
6eef70dc56 DRI2: Allow building without libdrm
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-03 11:56:03 +03:00
Tiago Vignatti
cdcb575664 DRI2: add AuthMagic hook for driver side support
With this new hook, drmAuthMagic becomes useless and should be deprecated.
You might want to implement AuthMagic on driver side instead.

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-03 11:55:05 +03: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
Chris Wilson
d90f2cd98a xfree86: Unbreak autoconfig following 0abf065e38
The move of the PCI device id probing into a separate file neglected to
return the number of found devices, and so the PCI devices were being
overwritten by the default entries for vesa and fbdev.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tiago Vignatti <tiago.vignatti@nokia.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-02 21:09:44 -07:00
Aaron Plattner
1304b8b27c Fix pixmap validation in miDbePositionWindow.
miDbePositionWindow allocates two pixmaps: a front buffer, and a back buffer.
If the buffers are supposed to be initialized, it validates a GC against the
front buffer, then uses it to fill and/or copy both the front buffer *and* the
back buffer, without revalidating.  If the acceleration architecture needs
different GC funcs for the two pixmaps -- for example if allocation of the front
buffer exhausted video memory -- then this can cause crashes because the GC is
not validated for the back buffer pixmap.

Fix this by performing the rendering for the front buffer first, then
revalidating against the back buffer before performing the back buffer
rendering.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-02 21:02:48 -07:00
Dave Airlie
91a6359caf composite: initialise pOldPixmap to NullPixmap at alloc time.
We just never initialised the malloced value.

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-02 21:01:09 -07:00
Nicolas George
968a79dcf5 Change keyboard controls on slave keyboards (#27926)
Makes the use of IsMaster in ProcChangeKeyboardControl consistent with other
similar loops.

Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-03 08:41:33 +10:00
Peter Hutterer
108b766c31 xfree86: initialize InputAttributes to NULL in the autoconfig code.
Reported-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-05-28 16:49:30 +10:00
Peter Hutterer
151659f963 test: fix up InputAttributes helper function test.
Just some extra clarification as pointed out by Dan Nicholson,
and that memcpy should have been a memcmp.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-05-28 16:49:30 +10:00
Peter Korsgaard
6cccf0131c dix: add 3x3 transformation matrix xinput property for multi-head handling
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-28 16:49:30 +10:00
Peter Hutterer
e4582d9e5c xfree86: bump ABI_XINPUT_VERSION to 11.
commit c2d0b3b437
"xfree86: store the InputAttributes in the input device."
introduced the new API. Bump the input version so drivers can handle this
appropriately.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-26 19:34:22 -07:00
Jamey Sharp
cd0ef0b6a2 dmx: Delete unused ChangeKeyboardDevice/ChangePointerDevice.
Daniel Stone deleted the API for these in 2006, in commit
96e32805d1.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-26 11:42:40 -07:00
Jamey Sharp
7045486491 Ignore build products in the server's test suite.
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>
2010-05-26 11:17:53 -07:00
Jamey Sharp
8bb88379d9 dmx: Remove dead __glXDispSwap_DrawArraysEXT definition.
Eric Anholt made the corresponding fix in glx/render2swap.c in commit
49d38ab232.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-26 11:17:23 -07:00
Jamey Sharp
c97a3ade5a dmx: Delete unused local variables.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-26 11:16:51 -07:00
Jamey Sharp
3c3d099fc1 dmx: Xfree -> free
Mikhail fixed the corresponding Xallocs, but missed these uses of Xfree
in commit 3f3ff971ec.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-26 11:13:13 -07:00
Jamey Sharp
01ca6400d9 Xephyr: Fix Xcalloc deprecation warnings.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-26 11:11:53 -07:00
Jamey Sharp
34df659687 xfree86/int10/helper_mem: Fix log message.
Three years ago in commit f62beb6f36 ajax
deleted the code that could have set this format string to anything
else, so just use the format string literal. This makes GCC happy since
it can check the argument types, which, by the way, weren't correct
since this format string doesn't need any arguments.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-05-26 11:10:55 -07:00
Jamey Sharp
0a98d9e6ce xf86bigfont: Silence compiler warning by initializing pDesc.
Access to pDesc was always guarded by (nCharInfos > 0), so the code
wasn't actually buggy, but this makes it clear that it's correct.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-26 11:10:27 -07:00
Keith Packard
4e9d3e4132 Revert "Add a "flags" field to DeleteInputDeviceRequest."
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 531ff40301.
2010-05-26 07:54:35 -07:00
Peter Hutterer
531ff40301 Add a "flags" field to DeleteInputDeviceRequest.
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-25 17:47:32 -07:00