Commit Graph

12100 Commits

Author SHA1 Message Date
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
Keith Packard
a557edca61 Merge remote-tracking branch 'whot/for-keith' 2012-08-27 08:06:09 -07:00
Peter Hutterer
24ffcfcded os: fix typo, fsync when WIN32 is _not_ defined
Introduced in 164b38c72f

Reported-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2012-08-23 14:48:18 +10:00
Peter Hutterer
d53e6e02a2 mi: don't check for core events in miPointerSetPosition (#53568)
As of 81cfe44b1e, miPointerSetPosition now
returns the screen pointer of the device. This broke floating slave devices,
as soon as a motion event was submitted, miPointerSetPosition returned NULL,
crashing the server.

dev->coreEvents is only false if the device is a floating slave, in which
case it has a sprite.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2012-08-23 14:48:14 +10:00
Keith Packard
6619f5c0e1 Relase 1.12.99.905
RC with updated ABI version numbers.

Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-21 13:46:34 -07:00
Peter Hutterer
bafbd99080 dix: work around scaling issues during WarpPointer (#53037)
In WarpPointer calls, we get input in screen coordinates. They must be
scaled to device coordinates, and then back to screen coordinates for screen
crossing and root coordinates in events.

The rounding errors introduced (and clipping in core/XI 1.x events) can lead
to the actual position being different to the requested input coordinates.
e.g. 200 scales to 199.9999, truncated to 199 in the event.

Avoid this by simply overwriting the scaled screen coordinates with the
input coordinates for the POINTER_SCREEN case.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2012-08-21 07:54:07 +10:00
Peter Hutterer
1ebba43052 os: don't block signal-unsafe logging, merely warn about it.
Throw an error into the log file, but continue anyway. And after three
warnings, stop complaining. Not all input drivers will be fixed in time (or
ever) and our printf implementation is vastly inferior, so there is still a
use-case for non-sigsafe logging.

This also adds more linebreaks to the message.

CC: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-21 07:54:07 +10:00
Peter Hutterer
4912b4adb6 os: add support for %d and %i to pnprintf
The mouse driver uses %i in some debug messages

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-21 07:54:07 +10:00
Peter Hutterer
7f8c39c8b5 Add FormatInt64 to convert signed integers in signal-safe manner
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-21 07:54:07 +10:00
Peter Hutterer
36c1d92ec0 test: add a few tests for signal-safe logging
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-21 07:54:07 +10:00
Peter Hutterer
b69536b475 test: assert from signal-safe number conversion
Throw an assert when the conversion fails instead of just returning. Asserts
are more informative.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-21 07:54:07 +10:00
Aaron Plattner
3e091e1075 xfree86: Bump extension ABI to 7.0
Commit 9d457f9c55 added an array of
DevPrivateSetRec structures in the middle of the ScreenRec, which throws off
extension modules trying to call things like pScreen->DestroyPixmap.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-17 16:17:19 -07:00
Jeremy Huddleston Sequoia
ac616d8ed5 XQuartz: Use asl_log_descriptor for children as well
This change is #if'd out due to a bug in asl_log_descriptor, but
it is left here as reference to be enabled in the future.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-16 19:44:00 -07:00
Jeremy Huddleston Sequoia
ad123071e5 XQuartz: Use asl_log_descriptor on Mountain Lion
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-16 19:44:00 -07:00
Jeremy Huddleston Sequoia
7c3d2e4828 XQuartz: console_redirect: Properly zero-out the tail of the array on realloc()
We forgot to multiply by sizeof(), so it wasn't fully zeroed out.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-16 19:44:00 -07:00
Jeremy Huddleston Sequoia
a32e01802f XQuartz: console_redirect: Set the correct location for reading into the buffer
Prior to this change, it was possible that a large message would have some
of its data prepended to subsequent messages due to our not incorrectly
setting the location to write into the buffer.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-16 18:32:50 -07:00
Keith Packard
ad5fe2d961 Merge remote-tracking branch 'jeremyhu/master' 2012-08-15 13:29:17 -07:00
Paul Berry
16d8da5ca9 glx: Skip multisampled configs when matching pre-existing X visuals.
In __glXScreenInit() we generate the set of GLX visuals in two steps:
first we match each pre-existing X visual with a corresponding
FBConfig, then we generate a new X visual to correspond to all the
remaining FBConfigs.

The first step is used for the two default 24-bit visuals (true color
and direct color) and for the 32-bit visual.  If windowsystem
multisampling is enabled in Mesa, we need to ensure that none of these
three visuals gets matched to a multisampled config.

Fixes a bug with windowsystem multisampling in gnome-shell.  If the X
server happens to match up a multisampled FBConfig to the 32-bit
visual, gnome-shell will try to use it to read pixels from
alpha-blended windows (such as gnome-terminal), resulting in no window
appearing on screen.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-15 13:25:08 -07:00
Jeremy Huddleston
99b94af1ff XQuartz: Fix build regression for GlxExtensionInit
quartz.c:153:6: error: use of undeclared identifier 'GlxExtensionInit'; did you mean 'GEExtensionInit'? [Semantic Issue]
    {GlxExtensionInit, "GLX", &noGlxExtension},

Regression-from: aad428b8e2
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-08-15 10:28:16 -07:00
Keith Packard
c0540b4c8d Kludge -- Call RandR screen before cleaning up xf86 crtcs
The core RandR screen cleanup now involves cleaning up any GPU screen
associations, and those call down into DDX to clean up the driver. If
the pointers from the xf86 structures back to the core randr
structures are set to NULL at that point, bad things happen.

This patch "knows" that the core RandR close screen is underneath the
xf86 randr close screen function, and so makes sure it gets called
first.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-08-14 17:14:55 -07:00
Keith Packard
288b87e42c Close GPU screens before core screens
This should make cleaning up the GPU screens easier as the core
screens they are associated with will still be around.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-08-14 17:13:52 -07:00
Keith Packard
19772670e3 Only free Render filter names on last screen close
Hotplugging screens causes the render filter names to get freed while
still in use; wait for the last core screen to be closed before
freeing them. That only happens at server reset, when we want them to
be freed.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-08-14 17:12:21 -07:00
Simon Schubert
863d528a9f fb: reorder Bresenham error correction to avoid overshoot.
When fbBresSolid draws a line, it can happen that after the last
pixel, the Bresenham error term overflows, and fbBresSolid paints
another pixel before adjusting the error term.

However, if this happens on the last pixel (len=0), this extra pixel
might overshoot the boundary, and, in rare cases, lead to a segfault.

Fix this issue by adjusting for the Bresenham error term before
drawing the main pixel, not after.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24274
Signed-off-by: Simon Schubert <2@0x2c.or>
Tested-by: Mitch Davis <mjd+freedesktop.org@afork.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-14 12:14:25 -07:00
Keith Packard
c22c936b35 Release 1.12.99.904
Closing the non-critical bug window for 1.13

Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-07 16:20:07 -07:00
Keith Packard
f94ec283ef Distribute include/glx_extinit.h
This changed should have been in aad428b8e2

Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-07 16:20:07 -07:00
Julien Cristau
9ca67de8fe Bump glproto requirement to 1.4.16
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-07 08:15:57 -07:00
Keith Packard
02f94b2d44 Merge remote-tracking branch 'whot/for-keith' 2012-08-06 16:52:12 -07:00
Keith Packard
360fa7736b Merge remote-tracking branch 'airlied/for-keithp' 2012-08-06 16:42:34 -07:00
Keith Packard
2100e72388 Merge remote-tracking branch 'alanc/master' 2012-08-06 16:40:54 -07:00
Peter Hutterer
7f09126e06 os: don't unconditionally unblock SIGIO in OsReleaseSignals()
Calling OsReleaseSignal() inside the signal handler releases SIGIO, causing
the signal handler to be called again from within the handler.

Practical use-case: when synaptics calls TimerSet in the signal handler,
this causes the signals to be released, eventually hanging the server.

Regression introduced in 08962951de.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-08-07 09:39:56 +10:00
Peter Hutterer
cb306a8f17 dix: make sure the mask is set for emulated scroll events (#52508)
If a device has smooth scrolling axes, but submits scroll button events, we
convert those to motion events and update the valuators. For legacy button
events, the valuator mask is likely unset though, causing
add_to_scroll_valuator() to return early, leaving us with an empty mask.
That again skipped the rest of the code and no events were generated.

Fix it by making sure that the scroll valuator in the mask is at least
initialized to 0.

Broke evdev wheel emulation, introduced by
54476b5e44.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-07 09:39:56 +10:00
Adam Jackson
4a6f42dda0 sync: Fix logic error from b55bf24858
That commit adds two hunks, and I _think_ they're backwards.  It adds
code to modify bracket_greater on NegativeTransition triggers, and
bracket_less on PositiveTransition triggers.  That breaks symmetry with
the surrounding code; the code as of this commit could probably be
simplified further.

I can't keep the sync trigger rules in my head for more than about five
minutes at a time, so I'm sending this on for more eyes.  RHEL 6.3's
xserver is shipping with b55bf248 reverted:

    https://bugzilla.redhat.com/show_bug.cgi?id=748704#c33

And there appear to be some upstream reports of the same issue:

    https://bugzilla.gnome.org/show_bug.cgi?id=658955

So I'd like to get this sorted out.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-06 16:14:37 -07:00
Dave Airlie
454d0e3a1b randr: fix xinerama output for output slaves
This fixes the xinerama geometry when output slaves are enabled.

Tested with xdpyinfo -ext XINERAMA before after slave added.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-06 15:42:39 -07:00
Dave Airlie
ac09a4a091 dri2: fix master pixmap free and reset pointer
These are two minor changes, one to reset the pointer to NULL,
after freeing the pixmaps, one to make sure we use the right API for
the master pixmap, though I doubt it'll ever really matter.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-07 08:25:45 +10:00
Dave Airlie
64623ef90d dri2: free slave pixmap on app exit
When the drawable disappears we need to free the prime master/slave combos.

This fixes a leak after a prime app is run.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-07 08:25:35 +10:00
Dave Airlie
1a465fef9b pixmap: have slave pixmap take a reference on master pixmap
Since the free routines free the master pixmap then the slave, we should
be taking a reference when we bind them together.

Fixes a use-after-free when resizing a primed gears.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-07 08:25:06 +10:00