Commit Graph

12091 Commits

Author SHA1 Message Date
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
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
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
Alan Coopersmith
c37c65052f Make indentation of dix/tables.c much more consistent and readable
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
2012-08-06 15:22:53 -07:00
Alan Coopersmith
9f7ef7f7f0 Fix up formatting of initializers for arrays of structs
The indenter seems to have gotten confused by initializing arrays of
structs with the struct defined inline - for predefined structs it did
a better job, so match that.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-08-06 15:22:53 -07:00
Alan Coopersmith
c7b7abfaa0 RRModeCreate: plug memory leak of newModes if AddResource fails
Reported by parfait 1.0:

Error: Memory leak (CWE 401)
   Memory leak of pointer 'newModes' allocated with realloc(((char*)modes), ((num_modes + 1) * 8))
        at line 93 of randr/rrmode.c in function 'RRModeCreate'.
          pointer allocated at line 82 with realloc(((char*)modes), ((num_modes + 1) * 8)).
Error: Memory leak (CWE 401)
   Memory leak of pointer 'newModes' allocated with malloc(8)
        at line 93 of randr/rrmode.c in function 'RRModeCreate'.
          pointer allocated at line 84 with malloc(8).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2012-08-06 15:22:53 -07:00
Alan Coopersmith
1eb7be8633 rrproperty.c: free newly allocated prop in more error paths
Reported by parfait 1.0:

Error: Memory leak (CWE 401)
   Memory leak of pointer 'prop' allocated with RRCreateOutputProperty(property)
        at line 220 of randr/rrproperty.c in function 'RRChangeOutputProperty'.
          'prop' allocated at line 154 with RRCreateOutputProperty(property).
          prop leaks when pending != 0 at line 160.
Error: Memory leak (CWE 401)
   Memory leak of pointer 'prop' allocated with RRCreateOutputProperty(property)
        at line 346 of randr/rrproperty.c in function 'RRConfigureOutputProperty'.
          'prop' allocated at line 334 with RRCreateOutputProperty(property).
        at line 350 of randr/rrproperty.c in function 'RRConfigureOutputProperty'.
          'prop' allocated at line 334 with RRCreateOutputProperty(property).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2012-08-06 15:22:53 -07:00
Alan Coopersmith
42e655de4d rrproviderproperty.c: free newly allocated prop in more error paths
Reported by parfait 1.0:

Error: Memory leak (CWE 401)
   Memory leak of pointer 'prop' allocated with RRCreateProviderProperty(property)
        at line 221 of randr/rrproviderproperty.c in function 'RRChangeProviderProperty'.
          'prop' allocated at line 155 with RRCreateProviderProperty(property).
          prop leaks when pending != 0 at line 161.

Error: Memory leak (CWE 401)
   Memory leak of pointer 'prop' allocated with RRCreateProviderProperty(property)
        at line 345 of randr/rrproviderproperty.c in function 'RRConfigureProviderProperty'.
          'prop' allocated at line 333 with RRCreateProviderProperty(property).
        at line 349 of randr/rrproviderproperty.c in function 'RRConfigureProviderProperty'.
          'prop' allocated at line 333 with RRCreateProviderProperty(property).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2012-08-06 15:22:53 -07:00
Keith Packard
94b514d5e4 Merge remote-tracking branch 'whot/for-keith' 2012-08-06 15:13:17 -07:00
Keith Packard
7d87545ba7 Merge remote-tracking branch 'jturney/master' 2012-08-06 15:11:13 -07:00
Keith Packard
ad707a7dcc Merge remote-tracking branch 'jeremyhu/master' 2012-08-06 15:08:01 -07:00
Keith Packard
5a51cb86f3 xfree86: When xf86CrtcCloseScreen is called, the randr CRTCs are gone
The RandR CRTC structures are freed when their resource IDs are
destroyed during server shut down, which is before the screen is
closed. Calling back into RandR with stale pointers just segfaults the
server.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Knut Petersen <knut_petersen@t-online.de>
2012-08-06 15:05:38 -07:00