Commit Graph

12285 Commits

Author SHA1 Message Date
Daniel Stone
314776eb36 Touch: Fix duplicate TouchBegin selection with virtual devices
Given the following scenario:
  1) client A selects for TouchBegin on window W for device D
  2) client B selects for TouchBegin on window W for XIAllDevices
  3) client C selects for TouchBegin on window W with device E

Step 3 will fail with BadImplementation, because attempting to look up
XIAllDevices or XIAllMasterDevices with dixLookupDevices doesn't work.
This should succeed (or, if it was selecting for device D, fail with
BadAccess as it would be a duplicate selection).

Fix this by performing the appropriate lookup for virtual devices.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Cc: Chase Douglas <chase.douglas@ubuntu.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-04 13:24:44 +10:00
Daniel Drake
3e6358ee6c Xi: Don't check for TOUCH_END, it's never set
This flag is never set, so checking for it here means that we'll
never release the simulated mouse button press after the user touches
(and releases) the touchscreen for the first time.

Fixes a problem where the XO laptop touchpad became totally
unusable after touching the screen for the first time (since X then
behaved as if the mouse button was held down all the time).

Signed-off-by: Daniel Drake <dsd@laptop.org>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-04 13:24:44 +10:00
Peter Hutterer
9d6b836570 dix: fix crash on XI 1.x grabs on disabled devices. (#54934)
If the device is disabled, the sprite window is NULL and dereferencing
crashes the server.

This is only triggered for XI 1.x grabs (ProcXGrabDevice) as XI2 grabs would
trigger another code path, creating a sprite for the disabled device as if
detaching it (which is wrong and fixed with this patch too).

Grabbing a disabled device doesn't make sense as it won't send events
anyway. However, the protocol specs do not prohibit it, so we need to keep
it working.
Luckily, oldWin is only used for focus out events, which aren't necessary
given that the device is disabled.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
2012-10-04 13:24:43 +10:00
Daniel Stone
3d2b768efa Touch: Fix duplicate TouchBegin selection with virtual devices
Given the following scenario:
  1) client A selects for TouchBegin on window W for device D
  2) client B selects for TouchBegin on window W for XIAllDevices
  3) client C selects for TouchBegin on window W with device E

Step 3 will fail with BadImplementation, because attempting to look up
XIAllDevices or XIAllMasterDevices with dixLookupDevices doesn't work.
This should succeed (or, if it was selecting for device D, fail with
BadAccess as it would be a duplicate selection).

Fix this by performing the appropriate lookup for virtual devices.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
2012-09-25 17:16:52 +10:00
Frederic Plourde
e3903a9383 Add glXCreateNewContext support in Xephyr #54798
Similar to how we intercept and pass through CreateContext, also pass
through newer CreateNewContext requests.

Fixes Clutter → Xephyr → VirtualBox.

Signed-off-by: Frederic Plourde <frederic.plourde@collabora.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2012-09-25 17:16:38 +10:00
Daniel Stone
11afebc92c Xephyr: GLX: Support MakeContextCurrent and MakeCurrentReadSGI
We need to pass these requests through to the host server in the same
way we do glXMakeCurrent.  Generalise the existing MakeCurrent
submission into once that will send MakeCurrent, MakeContextCurrent or
MakeCurrentReadSGI, depending on the request and the host server's
capabilities, and add decoding/hijack support for incoming
MakeContextCurrent and MakeCurrentReadSGI requests.

Fixes Clutter → Xephyr → VirtualBox.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-25 17:16:15 +10:00
Keith Packard
4dd5989d15 Merge remote-tracking branch 'ajax/server-1.14-abi-churn' 2012-09-24 11:43:01 -07:00
Yufeng Shen
0b02150c27 dix: fix scale_to_desktop for edge ABS events
Scale_to_desktop() converts ABS events from device coordinates
to screen coordinates:
[dev_X_min, dev_X_max]  -> [screen_X_min, screen_X_max]
[dev_Y_min, dev_Y_max]  -> [screen_Y_min, screen_Y_max]

An edge ABS event with X = dev_X_max (e.g., generated from the
edge of a touchscreen) will be converted to have screen X value
= screen_X_max, which, however, will be filterd out when xserver
tries to find proper Window to receive the event, because the
range check for a Window to receive events is
       window_X_min <= event_screen_X < window_X_max
Events with event_screen_X = screen_X_max will fail the test get
and rejected by the Window.

To fix this, we change the device to screen coordinates mapping to
[dev_X_min, dev_X_max]  -> [screen_X_min, screen_X_max-1]
[dev_Y_min, dev_Y_max]  -> [screen_Y_min, screen_Y_max-1]

Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Yufeng Shen <miletus@chromium.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-24 11:12:04 -07:00
Keith Packard
7722bcbab2 Merge remote-tracking branch 'jeremyhu/master' 2012-09-23 16:04:13 -07:00
Adam Jackson
4dc2a76740 miext/damage: Only wrap into the GC ops chain if there's a listener (v3)
before           after          Operation
--------    -----------------    -----------------
1148346.9   1191807.5 (  1.04)   PutImage 10x10 square
2091666.1   2180983.0 (  1.04)   ShmPutImage 10x10 square

v3: In miDamage{R,Unr}egister, bump the serial number of the affected
drawable (and all children if it's a window) so subsequent drawing
against the damage will trigger another ValidateGC pass and we wrap
in/out correctly.  Spotted by Aaron Plattner.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:47:18 -07:00
Adam Jackson
ad0156c369 dix: Remove MapUnmapEventsEnabled and friends
This hack was added to suppress events generated by Composite's internal
unmap/map cycle on redirection state change.  Since that cycle was
removed in 193ecc8b4, these can go.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ville Syrjälä <syrjala@sci.fi>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:41:54 -07:00
Adam Jackson
387b1ac33c dix: Factor out DeliverUnmapNotify
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:41:41 -07:00
Adam Jackson
d20cc0fca4 dix: Factor out DeliverMapNotify
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:41:26 -07:00
Adam Jackson
63843cb700 dix: Factor out MaybeDeliverMapRequest
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:40:38 -07:00
Adam Jackson
dab7a1ec7f dix: Fix some indentation
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:40:08 -07:00
Peter Hutterer
3d1051aecb dix: set the device transformation matrix
The property handler is registered after setting the property, so
dev->transform remains as all-zeros. That causes pixman_f_transform_invert()
to fail (in transformAbsolute()) and invert remains as garbage. This
may then cause a cursor jump to 0,0.

Since the axes are not yet initialized here and we need to allow for drivers
changing the matrix, we cannot use the property handler for matrix
initialization, essentially duplicating the code.

Triggered by the fix to (#49347) in 749a593e49

https://bugzilla.redhat.com/show_bug.cgi?id=852841

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:38:42 -07:00
Daniel Martin
1cb0261ef5 dix: Delete mibstore.h
Since Nov 2010 (commit c4c4676) the only purpose of mibstore.h was to
define an empty function (miInitializeBackingStore()) for backward
compatibility. Time to say goodbye.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:31:55 -07:00
Daniel Martin
08a9ed2524 dix: Remove refs to mi backing store from docs
Remove any reference to mibstore.h and miInitializeBackingStore() from
the documentation.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:31:39 -07:00
Daniel Martin
76d8739b1f dix: Remove #includes of mibstore.h
Remove more backing store leftovers.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:31:27 -07:00
Daniel Martin
056fd15dea dix: Delete mibstore.c
The only reference to mibstore.c was removed with commit c4c4676. Remove the
file itself too.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:30:34 -07:00
Jeremy Huddleston Sequoia
f54987de97 XQuartz: Add some verbose logging to debug xp_lock_window being unbalanced
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-09-22 14:09:58 -07:00
Jeremy Huddleston Sequoia
25d26875bc XQuartz: Avoid a possible deadlock with DRI on OS X 10.7.5 and OS X 10.8.2
<rdar://problem/12338921>
http://bugs.winehq.org/show_bug.cgi?id=31751

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-09-22 14:09:58 -07:00
Adam Jackson
506e3437c7 dix: Fix types in WindowOptRec
No reason for these to be 64 bits on LP64.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-20 14:40:18 -04:00
Adam Jackson
092c57ab17 os: Hide the Connection{In,Out}put implementation details
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-20 14:40:18 -04:00
Adam Jackson
e2c7d70e5d dix: Extend initial connection handshake for forwarding proxies
Forwarding proxies like sshd will appear to be local, even though they
aren't really.  This leads to weird behaviour for extensions that truly
require running under the same OS services as the client, like MIT-SHM
and DRI2.

Add two new legal values for the initial connection's byteOrder field,
'r' and 'R'.  These act like 'l' and 'B' respectively, but have the side
effect of forcing the client to be treated as non-local.  Forwarding
proxies should attempt to munge the first packet of the connection
accordingly; older servers will reject connections thusly munged, so the
proxy should fall back to passthrough if the munged connection attempt
fails.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-20 14:40:18 -04:00
Adam Jackson
31bf81772e dix: Repack ClientRec
Pick smaller types where possible, including bitfielding some Bools and
small enums, then shuffle the result to be hole-free.  192 -> 128 bytes
on LP64, 144 -> 96 bytes on ILP32.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-20 14:36:50 -04:00
Adam Jackson
ff8e3ad807 dix: Pull client-is-local flag up to the ClientRec
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-20 14:36:39 -04:00
Adam Jackson
3f7bc22263 os: Repack ConnectionOutput for LP64
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-20 14:36:36 -04:00
Keith Packard
d01921ec18 Merge remote-tracking branch 'ajax/ioperm' 2012-09-20 17:26:48 +02:00
Adam Jackson
5109c7f658 xfree86: Bump video ABI to 14
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-20 11:20:19 -04:00
Adam Jackson
245e7e0361 xfree86: Change the semantics of driverFunc(GET_REQUIRED_HW_INTERFACES)
This is a really awkward interface, since we're calling it well before
the driver knows what device it's going to drive.  Drivers with both KMS
and UMS support therefore don't know whether to say they need I/O port
access or not, and have to assume they do.

With this change we now call it only to query whether port access might
be needed; we don't use that to determine whether to call a driver's
probe function or not, instead we call them unconditionally.  If the
driver doesn't check whether port access was enabled, they might crash
ungracefully.  To accomodate this, we move xorgHWAccess to be explicitly
intentionally exported (sigh xf86Priv.h) so that drivers can check that
before they attempt port access.

v2: Move initial xf86EnableIO() nearer the logic that determines whether
to call it, suggested by Simon Farnsworth.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-20 11:07:27 -04:00
Adam Jackson
d88fb00d79 linux: Make failure to iopl non-fatal
We load the driver list, then enable I/O, then call driver probe based
on whether I/O enable succeeded.  That's bad, because the loaded
security policy might forbid port access.  We happen to treat that as
fatal for some reason, which means even drivers that don't need I/O
access (like kms and fbdev) don't get the chance to run.  Facepalm.

How about we just make that non-fatal instead, that sounds like a much
better plan.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-20 11:07:27 -04:00
Adam Jackson
048674a6ae linux: Refactor xf86{En,Dis}ableIO
Pull platform methods into their own sections for legibility, and
rewrite the ifdefs to be more concise.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-20 11:07:27 -04:00
Dave Airlie
70e5766874 xf86: fix multi-seat video device support. (v2)
If we are not seat 0 the following apply:

don't probe any bus other than platform
don't probe any drivers other than platform
assume the first platform device we match on the bus is the primary GPU.

This just adds checks in the correct places to ensure this, and
with this X can now start on a secondary seat for an output device.

v2: fix Seat0 macros
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-19 15:48:50 +10:00
Keith Packard
37d956e3ac xf86: fix compat output selection for no output GPUs
This should work properly with dynamic outputs.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-19 15:48:12 +10:00
Dave Airlie
e0b92f5f86 config/udev: ignore change on drm devices
for input devices we handle change like remove/add, but for
drm devices we get change events when we hotplug outputs,
so lets just ignore change at this level, and let the drivers
handle it. We may in the future want to route driver udev
from here instead.

Reported-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-19 10:47:04 +10:00
Dave Airlie
10672a5abe xf86/platform: scan pci after probing devices
This solves a race if we are trying to dynamically power off
secondary GPUs. Its not the greatest fix ever but it probably
as good as we can do for now.

The GPU probing causes the devices to be powered up, then when
we scan the PCI bus we get the correct information from the kernel,
rather than a bunch of 0xff due to the device being powered off.

drop gratuitous '&'.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-19 10:46:32 +10:00
Dave Airlie
22746df15b dri2: invalidate drawable after sharing pixmap
After we share the pixmap, the backing storage may have changed,
and we need to invalidate and buffers pointing at it.

This fixes GL compositors and prime windows lacking contents initially.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-17 09:52:03 +10:00
Keith Packard
f0bad69edd Version bumped to 1.13
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-05 14:45:08 -07:00
Keith Packard
856f80c8d7 Merge remote-tracking branch 'jeremyhu/master' 2012-09-05 11:02:58 -07:00
Dave Airlie
0db936a5b7 xf86: call enter/leave VT for gpu screens as well
Otherwise we can't do fast user switch properly for multiple GPUs.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-04 16:16:17 +10:00
Dave Airlie
18deac48db config/udev: respect seat for hotplugged video devices.
This respects the seat tag for hotplugged video devices at X start.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-04 16:16:02 +10:00
Dave Airlie
ec740cffeb config/udev: add wrapper around check if server is not seat 0
this is a simple clean-up that is useful to stop further propogation
of this construct.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-04 16:15:52 +10:00
Dave Airlie
49ec57d509 dix: free default colormap before screen deletion
If we don't free this here, it gets freed later in the resource
cleanups, however it then looks up up pmap->pScreen, which we
freed already in this function. So free the default colormap
when we should.

This fixes a bug after a couple of hotplug cycles when you try
to exit the X server and it crashes.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-04 16:15:52 +10:00
Dave Airlie
20f601a0fb xf86/crtc: don't free config->name
This is set by pre_init not screen init, so if we free it here
and then recycle the server, we lose all the providers.

I think we need to wrap FreeScreen here to do this properly,
will investigate for 1.14 most likely, safer to just leak this
on server exit for now.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-04 16:15:52 +10:00
Jeremy Huddleston Sequoia
b8ab93dfbc list: Use offsetof() and typeof() to determine member offsets within a structure
Some compilers have difficulty with the previous implementation which
relies on undefined behavior according to the C standard.  Using
offsetof() from <stddef.h> (which most likely just uses
__builtin_offsetof on modern compilers) allows us to accomplish this
without ambiguity.

This fix also requires support for typeof().  If your compiler does not
support typeof(), then the old implementation will be used.  If you see
failures in test/list, please try a more modern compiler.

v2: Added fallback if typeof() is not present.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-08-29 16:09:20 -07:00
Peter Hutterer
148583d62b tests: move GCC diagnostics pragma outside of function
This is a  a gcc 4.6+ feature.

signal-logging.c:210: error: #pragma GCC diagnostic not allowed inside
functions

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-29 01:11:29 -07:00
Jeremy Huddleston Sequoia
c75c947b6e test/list: Fix test_xorg_list_del test
We never use child[2], so it's state is undefined.

This issue seems to have existed since the test was first
written: 92788e677b

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-08-28 20:07:22 -07:00
Jeremy Huddleston Sequoia
486038fe16 XQuartz: Bump Info.plist version to 2.7.4
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-27 22:35:51 -07:00
Jeremy Huddleston Sequoia
b90b3f6eac test: Make os test more compliant
sighandler_t is not UNIX.

Regression from: 7f09126e06

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-08-27 22:10:05 -07:00