Commit Graph

11725 Commits

Author SHA1 Message Date
Peter Hutterer
642569fc79 Replace a few BUG_WARN with BUG_RETURN_VAL
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-06-07 13:30:54 +10:00
Peter Hutterer
11ecfb8884 include: add BUG_RETURN_* macros
Helper functions to avoid things like

if (foo) {
    BUG_WARN(foo);
    return 1;
}

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-06-07 13:30:35 +10:00
Peter Hutterer
ff41753b1b xkb: warn if XKB SlowKeys have been automatically enabled
Slow keys are enabled when the XKB AccessX features are generally enabled
(ctrls->enabled_ctrls & XkbAccessXKeysMask) and either shift key is held for
8 seconds. For the unsuspecting user this appears as if the keyboard
suddenly stops working.

Print a warning to the log, so we can later tell them "told you so".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-06-07 07:23:56 +10:00
Chase Douglas
12f9aaff38 test/touch: Initialize device name
Without this change, the test will segfault when we switch to signal-
safe logging.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-06-05 16:04:07 +10:00
Siddhesh Poyarekar
42ae2e8199 xkb: Allocate size_syms correctly when width of a type increases
The current code seems to skip syms with width less than
type->num_levels when calculating the total size for the new
size_syms. This leads to less space being allocated than necessary
during the next phase, which is to copy over the syms to the new
location. This results in an overflow leading to a crash.

Signed-off-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-06-04 11:28:44 +10:00
Michal Suchanek
88c767edb0 Fix crash for motion events from devices without valuators
A WarpPointer request may trigger a motion event on a device without
valuators. That request is ignored by GetPointerEvents but during smooth
scroll emulation we dereference dev->valuators to get the number of axes.

Break out early if the device doesn't have valuators.

Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-06-04 11:28:44 +10:00
Peter Hutterer
594b4a4f06 Xext: include dix-config.h
silences
In file included from ../include/misc.h:111:0, from hashtable.c:2:
./include/os.h:559:1: warning: redundant redeclaration of 'strndup' [-Wredundant-decls]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-05-24 15:52:38 +10:00
Julien Cristau
d348ab06aa Xvfb: destroy the screen pixmap in CloseScreen
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-24 14:57:21 +10:00
Julien Cristau
e4153c1d91 Xi: make stub DeleteInputDeviceRequest call RemoveDevice
DeleteInputDeviceRequest is called from CloseDownDevices on reset, so
call RemoveDevice to avoid leaking devices in Xvfb/Xnest/Xwin.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-24 14:57:11 +10:00
Marcin Slusarz
2d4fda4b09 xfree86: fix mouse wheel support for DGA clients
xf86-input-evdev (since "smooth scrolling" support was added) can send mouse
motion and wheel events in one batch, so we need to handle it properly.
Otherwise mouse wheel events which come with motion events are lost
and separate mouse wheel events are handled through non-DGA path.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-23 16:06:27 +10:00
Michal Srb
9bc53d8cb0 dri2: SProcDRI2Connect - send the response.
The swapped implementation of DRI2Connect is always responding with empty
device and driver values. However the response was only prepared and never
sent (also had undefined .type member), causing e.g. glxinfo get stuck waiting
for response when started remotely from machine with different endianity.

Signed-off-by: Michal Srb <msrb@suse.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-05-22 21:19:40 -07:00
Keith Packard
457fc77691 Merge remote-tracking branch 'alanc/master' 2012-05-22 10:32:29 -07:00
Dave Airlie
2e237c838f xf86: reimplement XF86SCRNINFO macro using new functions.
This macro did lookups via privates but we can just use the ScreenToScrn
conversion instead.

This patch drops all in-server uses, we should drop the macro later,
once drivers have been converted to not use it.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:59:20 +01:00
Dave Airlie
8da35202f3 xf86/modes: drop more pScrn->pScreen usages
Just simple conversion to use the lookup function.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:59:20 +01:00
Dave Airlie
e7a9e30fd2 xaa: convert pScrn->pScreen to use accessor.
This uses a standard conversion function to do the conversion.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:59:20 +01:00
Dave Airlie
738367ac9b xf86/modes: drop two uses of screenInfo
Just use new macros to access scrn->screen.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:59:20 +01:00
Dave Airlie
cc4fe613d0 render/exa: use glyph picture accessors
use the glyph picture accessors in the X server, render and EXA code.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:59:20 +01:00
Dave Airlie
a45e1d6cc6 render: add GetGlyphPicture accessor.
This is a new API to stop the drivers directly looking up the glyph pictures
in a global array. It provides a define GLYPH_HAS_GLYPH_PICTURE_ACCESSOR for
drivers to work in a compat way.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:59:20 +01:00
Dave Airlie
41151f88a6 xf86: migrate to using xf86ScreenToScrn wrapper (v2)
migrate to new helper API.

This just wraps all the obvious uses of xf86Screens[pScreen->myNum],
and should be fairly simple to review.

v2: remove commented out lines.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:59:08 +01:00
Dave Airlie
53932b3803 xf86: add helper functions to convert to from ScrnInfoPtr/ScreenPtr (v2)
These are just simple functions that we should start migrating drivers
to using.

The end goal is to remove xf86Screens and screenInfo from the ABI.

This includes a define XF86_HAS_SCRN_CONV that drivers can ifdef to provide
their own copies. I'll probably post a generic compat.h file for drivers later.

v2: add asserts.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:58:33 +01:00
Dave Airlie
39f73e813f xf86/pci: fix slot claiming counting.
Currently if we claim a slot for a PCI driver, we never let it go properly,
this prevents the fallback probe from reusing the slot, even though it
isn't claimed for that pci slot.

So if you set the modesetting driver to point at a specific kms device,
that isn't a PCI device (i.e. USB dongle), then the modesetting driver
loads, the pci probe tries to bind the config slot to the primary PCI
device, however we then check the kms device bus id to discover it
isn't valid. However we don't remove the claim on the slot. Next the
old probe function is called and there is no slots to claim.

This patch fixes that and converts the pciSlotClaimed boolean into
a counter, and changes the unclaim api to take a device pointer
to remove from the entity.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:58:33 +01:00
Dave Airlie
07dcc3f1a9 config/udev: add pre_init stage to config and udev.
In order to use udev for gpu enumeration, we need to init udev earlier
than input initialisations. This splits the config init stuff so that udev
pre init sets up before output initialisation.

this is just a prepatory patch, doesn't change anything major.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:58:32 +01:00
Dave Airlie
a2a02882ab xfree86: add modesetting driver to fallback list on Linux
Add the modesetting driver to the fallback list on Linux, after vesa
before fbdev.

Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:58:32 +01:00
Alan Coopersmith
5a3a98fcb7 Undocument Font Module loading
Code was deleted in commit affec10635

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-05-18 21:34:20 -07:00
Alan Coopersmith
afcb7ba24e Undocument mandatory loadable modules
The code to implement was deleted when BaseModules[] was emptied by
the replacement of the "pcidata" module with libpciaccess calls
in commit 46f55f5dea.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-05-18 21:34:20 -07:00
Alan Coopersmith
c3180a74a4 cvt man page should use Hz, not kHz, for vertical refresh rate
https://bugs.freedesktop.org/show_bug.cgi?id=48311

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2012-05-18 15:00:47 -07:00
Alan Coopersmith
96e0ab5496 Convert sbusPaletteKey to latest DevPrivate API
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-05-18 15:00:47 -07:00
Keith Packard
ba883a0f34 Merge remote-tracking branch 'jeremyhu/master' 2012-05-17 16:49:19 -07:00
Jeremy Huddleston
acdc4f54ee XQuartz: Avoid a race in initialization of darwinPointer
http://xquartz.macosforge.org/trac/ticket/579

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-17 16:32:06 -07:00
Jeremy Huddleston
c495211373 XQuartz: Declare noPseudoramiXExtension for miinitext.c
Regression-from: 6699f54fe0

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-17 16:21:23 -07:00
Jeremy Huddleston
f5fc533411 XQuartz: Provide fls implementation for Tiger
Regression-from: 30623d6ff7
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-17 16:00:05 -07:00
Jeremy Huddleston
e0097ce971 XQuartz: Tiger build fix
http://trac.macports.org/ticket/34364

Regression-from: 662d41acdd

Reported-by: Peter Dyballa <Peter_Dyballa@Freenet.DE>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-17 16:00:05 -07:00
Jeremy Huddleston
4acbaa3027 XQuartz: Workaround an SDK bug on Leopard/x86_64
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-17 16:00:05 -07:00
Peter Hutterer
ae1c48ebc8 Xi: fix "discards ''const' qualifier" warnings
extinit.c: In function 'XInputExtensionInit':
extinit.c:1301:29: warning: assignment discards 'const' qualifier from
pointer target type [enabled by default]
extinit.c:1303:36: warning: assignment discards 'const' qualifier from
pointer target type [enabled by default]

property.c: In function 'XIChangeDeviceProperty':
xiproperty.c:757:39: warning: cast discards '__attribute__((const))'
qualifier from pointer target type [-Wcast-qual]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-17 08:51:31 +10:00
Peter Hutterer
e42bf98283 Xi: fix "shadows previous local" warnings
exevents.c: In function 'DeepCopyFeedbackClasses':
exevents.c:272:20: warning: declaration of 'classes' shadows a previous
local [-Wshadow]
exevents.c:245:16: warning: shadowed declaration is here [-Wshadow]
(and a few more like this)

exevents.c: In function 'DeliverTouchEmulatedEvent':
exevents.c:1442:27: warning: declaration of 'win' shadows a parameter
[-Wshadow]
exevents.c:1404:55: warning: shadowed declaration is here [-Wshadow]
exevents.c:1475:28: warning: declaration of 'listener' shadows a parameter
[-Wshadow]
exevents.c:1403:62: warning: shadowed declaration is here [-Wshadow]

xiselectev.c: In function 'ProcXISelectEvents':
xiselectev.c:178:34: warning: declaration of 'dummy' shadows a previous
local [-Wshadow]
xiselectev.c:91:18: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-17 08:51:29 +10:00
Peter Hutterer
ca6d25ad2d dix: Move DeviceFocusEvent from Xi into enterleave.c
This is only called from the enterleave implementation, so move it and its
helper functions to there. No functional changes.

Fixes build error introduced in 31174565ec if
building with '-Werror=implicit-function-declaration'

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-17 08:50:44 +10:00
Peter Hutterer
749a593e49 dix: undo transformation for missing valuators (#49347)
last.valuators contains the transformed valuators of the device. If the
device submits events with x/y missing, we need to get that from
last.valuators and undo the transformation to that axis.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-16 10:59:39 +10:00
Peter Hutterer
03318835a5 include: don't redeclare device events in xkbsrv.h
../../include/xkbsrv.h:308:51: warning: redundant redeclaration of
‘DeviceKeyPress’ [-Wredundant-decls]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-16 10:59:39 +10:00
Peter Hutterer
43754803c1 test: don't shadow parameter 'len'
protocol-xiquerydevice.c:226:25: warning: declaration of ‘len’ shadows a
parameter [-Wshadow]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-16 10:59:39 +10:00
Peter Hutterer
1bafc9f26b test: fix redundant declaration of "BadDevice"
In file included from protocol-common.c:36:0:
protocol-common.h:36:12: warning: redundant redeclaration of ‘BadDevice’
[-Wredundant-decls]
In file included from protocol-common.c:30:0:
../../Xi/exglobals.h:41:12: note: previous declaration of ‘BadDevice’ was
here

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-16 10:59:39 +10:00
Peter Hutterer
47e1d0ea43 test: fix "userdata shadows global declaration" warnings
protocol-xiquerypointer.c:124:72: warning: declaration of
‘userdata’ shadows a global declaration [-Wshadow]

and similar

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-16 10:59:39 +10:00
Peter Hutterer
e6da635826 test: fix "redundant declaration of devices" warning
In file included from protocol-xiwarppointer.c:41:0:
protocol-common.h:91:23: warning: redundant redeclaration of ‘devices’
[-Wredundant-decls]
protocol-common.h:86:3: note: previous declaration of ‘devices’ was here

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-16 10:59:39 +10:00
Simon Thum
693a31e704 dix: indentation fixes for pointer acceleration
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>
2012-05-16 10:59:35 +10:00
Michal Suchanek
31174565ec dix: Remove redundant declarations.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:31:00 +01:00
Michal Suchanek
f1cec791d1 xfree86: Add ifdef wrapper to xvmodproc.h
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:29:20 +01:00
Michal Suchanek
d2f71b1394 Xi: Remove redundant declaration.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:30 +01:00
Michal Suchanek
a4f87f885a kdrive: Remove redundant declarations.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:26 +01:00
Michal Suchanek
369edd7876 dix: don't duplicate DoFocusEvents declaration.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:21 +01:00
Michal Suchanek
36377fb0e8 dix: Remove redundant declarations.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:17 +01:00
Michal Suchanek
ea9ed83f8f xfree86: don't include xvmodproc.h when not needed
The functions are already declared in xf86xv.h

Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:12 +01:00