Commit Graph

9863 Commits

Author SHA1 Message Date
Tiago Vignatti
7d8cabd027 os: simplify smart scheduler init process
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-09-10 21:49:29 +03:00
Tiago Vignatti
d9c18c3b9b os: remove useless smart scheduler macros
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-09-10 21:49:28 +03:00
Tiago Vignatti
a9e6080dc9 os/xfree86: remove macro checking for POSIX symbols
We assume already that our X implementation is POSIX compliant anyway. So
remove those redundant checking.

SA_SIGINFO is left there.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-09-10 21:49:28 +03:00
Adam Jackson
648c8871c9 composite: Convert compWindowUpdate to use TraverseTree
v2: Use != RedirectDrawNone, since we aren't called for manual windows.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-09-10 11:56:57 -07:00
Keith Packard
bbffb85461 Merge remote branch 'whot/for-keith' 2010-09-10 11:55:34 -07:00
Eamon Walsh
9a1a4ccbe0 Add screens to the PRIVATE_XSELINUX set.
The SELinux extension does store a security label in the screen
devPrivates.  Fixes crash caused by overwriting another private.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reported-by: Justin Mattock <justinmattock@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-09-10 11:55:01 -07:00
Vignatti Tiago (Nokia-MS/Helsinki)
5b680f2c23 os: add -sigstop option for Upstart (or equivalent) startup
This is very similar to the RunFromSmartParent (implicit) option, except
we do not send the signal to our parent process, but our own process
instead, and that signal is SIGSTOP, not SIGUSR1.

Upstart or a similar equivalent program will detect this, realize that
we are ready to accept clients now, send us SIGCONT and move our job
status from SPAWNED to RUNNING.

Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-09-10 11:54:14 -07:00
Keith Packard
ca0d578d29 Merge remote branch 'mattst88/master' 2010-09-10 11:50:27 -07:00
Aaron Plattner
cf88363db0 os: Return BadLength instead of disconnecting BigReq clients (#4565)
If a client sends a big request that's too big (i.e. bigger than
maxBigRequestSize << 2 bytes), the server just disconnects it.  This makes the
client receive SIGPIPE the next time it tries to send something.

The X Test Suite sends requests that are too big when the test specifies the
TOO_LONG test type.  When the client receives SIGPIPE, XTS marks it as
UNRESOLVED, which counts as a failure.

Instead, remember how long the request is supposed to be and then return that
size.  Dispatch() checks the length and sends BadLength to the client.  Then,
whenever oci->ignoreBytes is nonzero, ignore the data read instead of trying to
process it as a request.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-09-10 11:48:17 -07:00
Keith Packard
fa22f97af6 Merge remote branch 'vignatti/vgaarb-fixes' 2010-09-10 11:47:41 -07:00
Aaron Plattner
6edbdb7f9e Tag sdksyms.c entries with source file and line number
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-09-10 11:45:03 -07:00
Eamon Walsh
9ef6241c23 Fix property and selection devPrivate allocation.
Selection objects were not being allocated with privates, and both
objects had a stray statement that zeroed out the devPrivates field.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reported-by: Justin Mattock <justinmattock@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-09-10 11:44:12 -07:00
Peter Hutterer
9dca441670 xfree86: add a hook to replace the new console handler.
This hook is only necessary for the keyboard driver to remove the race
condition between drain_console() and the driver's ReadInput (Bug 29969).

The idea is that a driver that needs to handle events from the console
calls xf86ReplaceConsoleHandler() with it's own ReadInput (or NULL) and thus
removes the drain_console call. It's the driver's responsibility to restore
the previous behaviour when the driver is unloaded.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
CC: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-09-10 09:09:47 +10:00
Thomas Hellstrom
da31ca747f linux: Don't lose console events on non-evdev drivers (#29969)
The drain_console() function will race with new keyboard events being added
by the hardware causing the server to lose keyboard events if the console fd
is used for input.

Only use the drain_console() when AllowEmptyInput is off which is the best
indicator we have for whether the keyboard driver will be used. This patch
will only fix the bug when hotplugging is disabled.
What we really need is a way to figure out either whether we're _not_ using
the keyboard driver (not predictable) or a way for the keyboard driver to
disable drain_console().

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

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 71972c2534)
2010-09-10 09:09:46 +10:00
Peter Hutterer
52df92a563 xfree86: move XI_VERIFY_VALUATORS to the source file it's used in.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-09-10 09:09:46 +10:00
Peter Hutterer
824e970c5c xfree86: remove TS_Raw and TS_Scaled defines.
There are no references to it other than the commit that added them. But
since we're re-doing the API anyway, now is a good time to break things.

commit 9398d62f27
Author: Daniel Stone <daniel@fooishbar.org>
Date:   Wed Mar 21 00:18:24 2007 +0200

    XFree86 input: Add backwards compatibility for motion history
    Add the old motion history API back, as a shim around the new mi
    API.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-09-10 09:09:46 +10:00
Peter Hutterer
ac3f88e604 xfree86: remove {Dont}SendCoreEvents defines
The input drivers that use it only do so with ABI 0 and we're long past this
one now. Input driver don't have a say in whether they send core events now
anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-09-10 09:09:46 +10:00
Peter Hutterer
3f264149ff xfree86: don't export xf86InputDevs.
Use xf86FirstLocalDevice() instead (but don't get me started on the naming
of that one...)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10 09:09:40 +10:00
Peter Hutterer
8f0531bdda xfree86: remove XI_PRIVATE macro, unused.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10 09:09:32 +10:00
Peter Hutterer
c08f7afdbc xfree86: update comment for xf86DeleteInput
We have a driver hook - it's UnInit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10 09:09:21 +10:00
Peter Hutterer
b8d9c5ff00 xfree86: remove IDevRec, replace with InputInfoRec.
This struct is superfluous, maintaining the same info as the InputInfoRec
(with the exception of the driver name).

This is a rather large commit with the majority of changes being a rename
from the fields of the IDevRec (idev, commonOptions) to the InputInfoRec
(pInfo, options).

The actual changes affect the initialization process of the input device:
In NewInputDeviceRequest, the InputInfoRec is now always allocated and just
added to the internal list in xf86NewInputDevice() if the init process
succeeded.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-09-10 09:09:20 +10:00
Peter Hutterer
c5da32a610 xfree86: plug minor memory leak.
When no identifier for the device was specified, the allocated IDevRec (and
its associated fields) need to be freed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10 09:09:12 +10:00
Peter Hutterer
34ade08174 xfree86: Remove extraOptions parameter from xf86CollectInputOptions.
And unexport it, drivers don't need to call this in the new init process.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-09-10 09:09:11 +10:00
Peter Hutterer
2199842ed5 xfree86: remove extraOptions field from IDevRec.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-09-10 09:09:11 +10:00
Peter Hutterer
5ab8ca0807 xfree86: remove some ifdef 0 code.
InputInfoRec hasn't had a free function pointer since the git import.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10 09:09:02 +10:00
Peter Hutterer
b0da1bc509 xfree86: move a declaration down to the block it is used in.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10 09:08:54 +10:00
Peter Hutterer
cd7059db4a xfree86: minor comment fix. HAL → config backend
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10 09:08:46 +10:00
Peter Hutterer
f3861522fe xfree86: skip a few NULL initialization, calloc does it for us.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10 09:08:39 +10:00
Peter Hutterer
1217097861 xfree86: remove conversion procs and close proc from InputInfoRec.
None of them are called by the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10 09:08:27 +10:00
Thomas Hellstrom
71972c2534 linux: Don't lose console events on non-evdev drivers (#29969)
The drain_console() function will race with new keyboard events being added
by the hardware causing the server to lose keyboard events if the console fd
is used for input.

Only use the drain_console() when AllowEmptyInput is off which is the best
indicator we have for whether the keyboard driver will be used. This patch
will only fix the bug when hotplugging is disabled.
What we really need is a way to figure out either whether we're _not_ using
the keyboard driver (not predictable) or a way for the keyboard driver to
disable drain_console().

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

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-09 10:53:34 +10:00
Peter Hutterer
e00e2e7b68 xfree86: Check for existence of button class before dereferencing it.
The Irxon Super Mini Bluetooth Wireless Keyboard for PC/PDA/Cell Phones
keyboards have axes but not buttons. The evdev driver doesn't set up a
button class for these keyboards and a motion event handled by
DGAProcessPointerEvent dereferences the dev->button NULL pointer, causing a
server crash.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-09-06 13:13:42 +10:00
Peter Hutterer
9802cca816 Remove atom field from InputInfoRec.
This field was only used in one location where we can use a local variable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-09-06 12:44:17 +10:00
Peter Hutterer
79ea9ef399 input: constify valuators passed in by input drivers.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-09-06 12:44:10 +10:00
Peter Hutterer
86560b5d05 dix: don't set time to CurrentTime in DeviceChangedEvents.
CurrentTime is used by clients to skip setting the time, but not by the
server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-09-02 16:12:55 +10:00
Peter Hutterer
ff055506f0 dix: fix crash when removing devices on a buttonless MD pointer (#29669)
If the master does not have a button class, recalculating the number of
buttons required for this master dereferences a NULL pointer. Guard against
this, if the master pointer doesn't have a button class, it doesn't need to
update it's number of buttons.

Reproducible:
Two devices on the same master, device NB with axes but no buttons, device
A+B with axes and button .
If NB was the last one to send an event through the master when A+B is
removed from the server, master->button is NULL and leads to the above
NULL-pointer dereference.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-09-02 16:12:52 +10:00
Jesse Adkins
be978c7fc9 xfree86: Purge kbdCustomKeycodes from xf86Info.
This was obsolete after 3eeb62e8f5 "bug #890: completely remove deprecated keyboard driver".

Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-01 15:27:20 +10:00
Peter Hutterer
6922b31a13 xfree86: remove history_size
For a couple of ABIs now the history size was essentially static anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-01 15:27:20 +10:00
Peter Hutterer
892e39025b xfree86: remove always_core_feedback from InputInfoRec.
Unused

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-01 15:27:20 +10:00
Peter Hutterer
5e2912bd1d xfree86: remove first/last from InputInfoRec.
Unused.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-01 15:27:19 +10:00
Peter Hutterer
974bc2322b xfree86: remove private_flags from InputInfoRec.
Unused field.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-01 15:27:19 +10:00
Peter Hutterer
23b361b25b xfree86: Purge old_x/old_y from InputInfoRec.
Unused field.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-01 15:27:19 +10:00
Peter Hutterer
4ac3be29bc input: Purge AddOtherInputDevices DDX hook.
This hook wasn't used by any DDX. Device addition and removal is handled by
the config backend, so we don't need to do anything special that during the
ListInputDevices request processing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01 15:26:52 +10:00
Peter Hutterer
cb672a461c input: remove OpenInputDevice and CloseInputDevice DDX hooks.
In theory, these hooks were to be used for DDX-specific device enablement.
None of the DDXs however did anything here. Now we call DEVICE_INIT on all
devices when they are added, so the xfree86 DDX as the only one with real
code didn't do anything here.

kdrive checked for device validity but that's already handled in
ProcXOpenDevice.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01 15:26:51 +10:00
Simon Thum
a46d2bb344 xfree86: Fix xf86 backend-specific input initialization
Instead of shoving it in rather unrelated places, move acceleration init
into xf86NewInputDevice.

Caveat: It's not clear atm how relevant other callers of ActivateDevice
(like OpenDevice) actually are.

Signed-off-by: Simon Thum <simon.thum@gmx.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01 15:26:51 +10:00
Peter Hutterer
e930710ae5 xfree86: purge superfluous includes from xf86Xinput.c
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01 15:26:51 +10:00
Peter Hutterer
2b7840b63d xfree86: remove unused DeviceAssocRec struct.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01 15:26:50 +10:00
Peter Hutterer
cdb5863c9f xfree86: remove LocalDeviceRec/Ptr definition.
Two names pointing to the same struct for over 7 years now. Remove the
define, if drivers don't want to change they can always do the typedef
themselves.

Rename all "LocalDevicePtr local" to "InputInfoPtr pInfo".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01 15:26:50 +10:00
Peter Hutterer
8764782f6d xfree86: add xf86IDrvMsg and friends for input driver logging.
Input driver messages are only standardised by convention, with the drivers
prefixing the device name to most messages. This makes it rather hard to
grep on "evdev" for example when looking for the evdev ouput.

This patch adds three new logging functions, modeled after xf86DrvMsg(), the
logging function for output drivers. New functions are
   xf86IDrvMsg()        - input driver log message in default verbosity.
   xf86IDrvMsgVerb()    - input driver log message in specified verbosity.
   xf86VIDrvMsgVerb()   - same as xf86IDrvMsgVerb() but takes a varargs
                          argument.

Default log format is <driver name>: <device name>: <message>.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01 15:26:50 +10:00
Peter Hutterer
b55ac354af xfree86: move xf86AllocateInput and xf86DeleteInput to xf86Xinput.c
Make xf86AllocateInput static in the process, this function is only called
from one location.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01 15:26:49 +10:00
Peter Hutterer
d2a5f41664 xfree86: return the device from xf86ActivateDevice.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01 15:26:49 +10:00