Commit Graph

1077 Commits

Author SHA1 Message Date
Keith Packard
41da295eb5 Trap SIGBUS to handle truncated shared memory segments
If a client passes a section of memory via file descriptor and then
subsequently truncates that file, the underlying pages will be freed
and the addresses invalidated. Subsequent accesses to the page will
fail with a SIGBUS error.

Trap that SIGBUS, figure out which segment was causing the error and
then allocate new pages to fill in for that region. Mark the offending
shared segment as invalid and free the resource ID so that the client
will be able to tell when subsequently attempting to use the segment.

Signed-off-by: Keith Packard <keithp@keithp.com>

v2: Use MAP_FIXED to simplify the recovery logic (Mark Kettenis)
v3: Also catch errors in ShmCreateSegment

Conflicts:
	include/dix-config.h.in
	include/xorg-config.h.in
2013-11-11 15:16:07 -08:00
Keith Packard
719e880d76 Require libXtrans version 1.3.2
This has the FD passing support included

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-11-11 15:14:36 -08:00
Keith Packard
ea8acfe3e2 Require xextproto version 7.2.99.901
This includes the MIT-SHM FD passing requests

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-11-11 15:12:02 -08:00
Keith Packard
7aad79c5a5 Make XTrans FD passing support optional. Define only on Linux
Until other operating systems have a libXtrans port for FD passing,
disable this on non-Linux systems.

Note that this define affects how libXtrans gets built into the X
server, which is why it need only define the symbol

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-11 15:11:39 -08:00
Keith Packard
8fcf82cbf0 Use $GL_LIBS instead of -lGL for linking
-lGL presumes that the GL library is in the system path, while
 $GL_LIBS is auto-detected.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-05 18:39:11 -08:00
Keith Packard
f348935e7d Link with xshmfence, reference miSyncShmScreenInit in sdksyms
This gets the server to link with xshmfence again, and also ensures
that the miSyncShm code is linked into the server with the reference
from sdksyms.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-05 18:37:12 -08:00
Keith Packard
aaf0e29619 Disable DRI3 and sync fence FD functions if xshmfence isn't available
Make sure the server can build when the xshmfence library isn't present

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-04 18:53:36 -08:00
Keith Packard
33c85beed5 Set version to 1.14.99.901 (1.15 RC1)
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-01 01:45:22 -07:00
Keith Packard
977e2644b1 Merge remote-tracking branch 'whot/for-keith' 2013-11-01 00:34:18 -07:00
Egbert Eich
66c5ee0ff4 config/APM: Add option to disable building of APM support on Linux
APM support in the Xserver was used to restore the console mode
    prior to a power management event. This was to ensure the mode
    upon suspend/resume was one that the system firmware or kernel
    could deal with.
    APM support is now largely obsolete, KMS drivers don't require a
    mode restoration anyhow. Therefore it should be possible to disable
    this feature.

(small modification by keithp - move test for XF86PM flag after check
for APM, then move XF86PM flag to xorg-config.h.in)

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-01 00:28:43 -07:00
Egbert Eich
f994d99539 config/ACPI: Add option to disable building of ACPI support on Linux
ACPI support in the Xserver was used to restore the console mode
prior to a power management event. This was to ensure the mode
upon suspend/resume was one that the system firmware or kernel
could deal with.
The feature depended on acpid to be running. Most of this functionality
is now take over by systemd, KMS drivers don't require a mode restoration
anyhow. Therefore it should be possible to disable this feature under
some circumstances.

Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-01 00:06:40 -07:00
Keith Packard
5c5c1b7798 present: Add Present extension
Provides both a software implementation using timers and driver hooks
to base everything on vblank intervals.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:59:18 -07:00
Keith Packard
5631382988 dri3: Add DRI3 extension
Adds DRM compatible fences using futexes.
Uses FD passing to get pixmaps from DRM applications.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:58:30 -07:00
Peter Hutterer
f12a9ed870 configure: remove a comment
94ed0ba1b5 moved backtracing into the DIX, so
this comment is outdated. since no-one noticed and it's easier to just grep
than update file references, remove the comment.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2013-11-01 09:39:53 +10:00
Keith Packard
1470c0a132 Merge remote-tracking branch 'whot/for-keith' 2013-10-29 21:00:13 -07:00
Gaetan Nadon
9f4afe7e83 config: replace deprecated use of AC_OUTPUT with AC_CONFIG_FILES
Fix Automake warning: AC_OUTPUT should be used without arguments.
www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Files

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-30 07:41:26 +10:00
Keith Packard
b32a4c91cc Merge remote-tracking branch 'idr/glx-float-fbconfig' 2013-10-29 09:37:30 -07:00
Adam Jackson
be6680967a glx: convert to direct GL dispatch (v2)
We now expect to be linked against something that provides the GL API,
instead of manually grubbing about in the DRI driver's dispatch table.
Since the GLX we expose calls GL functions that are meant to be looked
up dynamically, also add a way to thunk through to GetProcAddress.

This includes a refresh of the generated sources, which requires a
correspondingly new Mesa.

The GetProcAddress stubs are at the moment merely enough to make this
link against Mesa 9.2, but should really be provided for everything not
in the OpenGL 1.2 ABI.

v2: Explicitly hide the GetProcAddress stubs so we can't conflict with
libGL symbols; fix leading tab/space issues [anholt]

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 12:29:16 -04:00
Adam Jackson
8aacf47e17 glx: Remove DRI1 AIGLX (v2)
Mesa doesn't ship DRI1 drivers as of 8.0, which is about 18 months and
three releases ago.  The main reason to have wanted DRI1 AIGLX was to
get a GLX compositor working, but DRI1's (lack of) memory management API
meant that the cost of a GLX compositor was breaking direct GLX apps,
which isn't a great tradeoff.

Of the DRI1 drivers Mesa has dropped, I believe only mga stands to lose
some functionality here, since it and only it has support for
NV_texture_rectangle.  Since that's required for every extant GLX
compositor I know of, I conclude that anybody with a savage, say, would
probably not notice AIGLX going away, since they wouldn't be running a
GLX compositor in the first place.

In the future we'd like to use GL in the server in a more natural way,
as just another EGL client, including in the GLX implementation itself.
Since there's no EGL implemented for DRI1 drivers, this would already
doom AIGLX on DRI1 (short of entirely forking the GLX implementation,
which I'm not enthusiastic about).

v2: Remove DRI1 from AIGLX conditionals in configure.ac [anholt]

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 10:30:43 -04:00
Daniel Czarnowski
ccc8bb1153 glx: Handle float config types in glxConvertConfigs
Replaces old use of floatMode attribute with new, extended range of
values in __DRI_ATTRIB_RENDER_TYPE. Also adds new conditions, where the
float modes support requires it. Enables support for not only float
configs, but packed float configs as well.

v2 (idr): Whitespace and formatting fixes.  Refactor render type
vs. pbuffer checking to a separate function that includes a quote from
the spec.  Re-write commit message.  Fix compiler warnings:

glxdricommon.c: In function 'glxConvertConfigs':
glxdricommon.c:212:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign]
glxdricommon.c:212:35: note: expected 'unsigned int *' but argument is of type 'int *'
glxdricommon.c:230:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign]
glxdricommon.c:230:35: note: expected 'unsigned int *' but argument is of type 'int *'

Signed-off-by: Daniel Czarnowski <daniel.czarnowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-24 11:47:42 -07:00
Keith Packard
8db4121a3c Update to version 1.14.99.3
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-18 17:31:01 -07:00
Emil Velikov
ea3b7db4b7 configure.ac: Include missing proto declarations in SDK_REQUIRED_MODULES
Commits a1d41e311c, 7d859bd878 & 3ed2c6e112 made extinit.h require
the XF86 Big Font, XRes & ScrnSaver proto headers, but failed to add them
to the SDK_REQUIRED_MODULES so pkg-config would find them for driver builds.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-07 11:20:58 -07:00
Keith Packard
f0659a7f68 Bump version to 1.14.99.2
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-04 16:44:46 -07:00
Keith Packard
f3b529bf25 Merge remote-tracking branch 'anholt/ephyr-fixes' 2013-10-04 14:04:48 -07:00
Keith Packard
47ff382d1f Merge remote-tracking branch 'jturney/master' 2013-09-09 15:13:42 -07:00
Thomas Klausner
6f89ae3e64 Fix typo in configure warning.
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-06 07:04:23 +10:00
Julien Cristau
3309a73c82 Xephyr: drop remaining Xlib dependency
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:02:03 -07:00
Julien Cristau
68b7db19e8 Xephyr: move ephyrdri over to xcb
Require new xcb-xf86dri to get fixed GetDrawableInfo.

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:01:00 -07:00
Julien Cristau
aea119cd05 Xephyr: use xcb-xv instead of libXv
v2: Massive, conflict-filled rebase.  I think I resolved everything
    right, but this host xv code makes my eyes bleed.  Touch-tested XV
    after the rebase (anholt).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:00:59 -07:00
Julien Cristau
126312fb4a Xephyr: replace XKeycodeToKeysym with xcb-keysyms
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
a2b73da78d Xephyr: start converting hostx.c over to xcb
v2: Dropped the hostx_load_keymap changes, now that that function is
    gutted (anholt).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:00:59 -07:00
Jon TURNEY
e716baedc4 Move pseudoramiX code where it can be shared between Xwin and Xquartz
Move pseudoramiX code to a separate top-level directory.  Link Xwin and Xquartz
with libPseudoramiX

I'm not sure moving this to a top-level directory is appropriate, but I'm not
sure where else it fits.

Future work: pseudoramiX can probably be consolidated with the rrxinerama code
(which I think provides fake xinerama data when real XINERAMA is disabled and we
only have one screen)

v2: fix distcheck

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:52:30 +01:00
Julien Cristau
c218ba8423 xfree86: improve check for posix saved ids
Replace hardcoded SVR4 || linux || CSRG_BASED with an autoconf check and
the _POSIX_SAVED_IDS macro.

Suggested-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-06 13:03:25 +10:00
Jon TURNEY
2663203cd6 configure.ac: Check for python at configure time when building XWin with AIGLX
Check for python at configure time when building XWin with AIGLX, it's used to
generate the wrapper code for native GL functions.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:34 +01:00
Jon TURNEY
15febb05d7 Allow DDX to provide a main()
XQuartz already conditionally renames main() as dix_main() so it can provide
it's own main().  This isn't the ideal way of doing this, as it prevents libdix
built this way from being useful with any other DDX.

So instead, always name that function dix_main(), and also provide a stub main()
which just calls dix_main(), which can be overriden in the DDX.

Add a main() to XWin (XQuartz already has one, of course).

It's no longer neccessary to link XWin and XQuartz with libmain.

v2: Remove unneeded stub main hw/xwin/InitOutput.c

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:56:58 +01:00
Alan Coopersmith
ddc52b9cba Xephyr: Use _XEatDataWords (from Xlib 1.6) instead of _XEatData
Simplifies code and reduces risk of overflow from converting length
field in X replies from words to bytes.

One call to _XEatData is left in ephyrHostGLXGetStringFromServer where
it's already been checked for overflow, and other values have been
subtracted from it to reduce the size of data remaining to be eaten.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-17 18:10:41 -07:00
Alan Coopersmith
a3d43edf71 glxproxy: Use _XEatDataWords (from Xlib 1.6) instead of _XEatData
Reduces risk of overflow from converting length field in X replies
from words to bytes.   (Also seems to be what several calls were
already incorrectly passing to _XEatData.)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-17 18:10:41 -07:00
Peter Hutterer
623981ddae If neither HAL nor udev backends are enabled, warn the user
If both are missing,  input device hotplugging will not work out of the box.
While we still have a DBus-API or the user may want to set AAD off all the
time, the most likely source of this is misconfiguration (i.e. lack of the
udev/hal devel packages).

Message printed last to make it more obvious to the user.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:40:46 +10:00
Keith Packard
2b539239e4 Bump to 1.14.99.1
Snapshot with fix for CVE-2013-1940.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-24 10:11:03 -07:00
Keith Packard
c2ede8f92f Merge remote-tracking branch 'whot/for-keith' 2013-03-18 11:26:24 -07:00
Keith Packard
116f020102 Merge remote-tracking branch 'whot/next' 2013-03-18 11:18:58 -07:00
Keith Packard
679ccecd8b Bump release to 1.14.99.0
Get us off the release number so that we don't conflict with the
stable branch.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-03-18 10:02:00 -07:00
Robert Morell
31595b5286 configure.ac: Require inputproto 2.3
This picks up support for Xi pointer barriers in the protocol.

Signed-off-by: Robert Morell <rmorell@nvidia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-03-13 08:55:19 +10:00
Keith Packard
103b77c59e Version bumped to 1.14
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-03-05 22:31:17 -08:00
Marcin Slusarz
e21e183059 os: use libunwind to generate backtraces
Libunwind generates backtraces much more reliably than glibc's "backtrace".

Before:
0: /opt/xserver/bin/X (0x400000+0x18ce36) [0x58ce36]
1: /opt/xserver/bin/X (xorg_backtrace+0x9) [0x58d119]
2: /opt/xserver/bin/X (0x400000+0x190d69) [0x590d69]
3: /lib64/libpthread.so.0 (0x7fb904268000+0x10a90) [0x7fb904278a90]
4: /lib64/libc.so.6 (ioctl+0x7) [0x7fb902fbf987]
5: /usr/lib64/libdrm.so.2 (drmIoctl+0x28) [0x7fb90405ffa8]
6: /usr/lib64/libdrm.so.2 (drmCommandWrite+0x1b) [0x7fb90406235b]
7: /usr/lib64/libdrm_nouveau.so.2 (nouveau_bo_wait+0x89) [0x7fb902009719]
8: /opt/xserver/lib/xorg/modules/drivers/nouveau_drv.so (0x7fb90220e000+0x76f3) [0x7fb9022156f3]
9: /opt/xserver/lib/xorg/modules/libexa.so (0x7fb9019c7000+0xbae0) [0x7fb9019d2ae0]
10: /opt/xserver/bin/X (0x400000+0x17d2b3) [0x57d2b3]
11: /opt/xserver/bin/X (0x400000+0xc9930) [0x4c9930]
12: /opt/xserver/bin/X (0x400000+0x3a81a) [0x43a81a]
13: /opt/xserver/bin/X (0x400000+0x3d6a1) [0x43d6a1]
14: /opt/xserver/bin/X (0x400000+0x2c2ca) [0x42c2ca]
15: /lib64/libc.so.6 (__libc_start_main+0xf5) [0x7fb902f019b5]
16: /opt/xserver/bin/X (0x400000+0x2c60d) [0x42c60d]
17: ?? [0x0]

After:
0: /opt/xserver/bin/X (OsSigHandler+0x39) [0x590d69]
1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x7fb904278a8f]
2: /lib64/libc.so.6 (ioctl+0x7) [0x7fb902fbf987]
3: /usr/lib64/libdrm.so.2 (drmIoctl+0x28) [0x7fb90405ffa8]
4: /usr/lib64/libdrm.so.2 (drmCommandWrite+0x1b) [0x7fb90406235b]
5: /usr/lib64/libdrm_nouveau.so.2 (nouveau_bo_wait+0x89) [0x7fb902009719]
6: /opt/xserver/lib/xorg/modules/drivers/nouveau_drv.so (nouveau_exa_download_from_screen+0x1a3) [0x7fb9022156f3]
7: /opt/xserver/lib/xorg/modules/libexa.so (exaGetImage+0x1f0) [0x7fb9019d2ae0]
8: /opt/xserver/bin/X (miSpriteGetImage+0x173) [0x57d2b3]
9: /opt/xserver/bin/X (compGetImage+0xb0) [0x4c9930]
10: /opt/xserver/bin/X (ProcGetImage+0x55a) [0x43a81a]
11: /opt/xserver/bin/X (Dispatch+0x341) [0x43d6a1]
12: /opt/xserver/bin/X (main+0x3ba) [0x42c2ca]
13: /lib64/libc.so.6 (__libc_start_main+0xf5) [0x7fb902f019b5]
14: /opt/xserver/bin/X (_start+0x29) [0x42c60d]
15: ? (?+0x29) [0x29]

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Knut Petersen <knut.petersen@t-online.de>
2013-02-26 07:59:53 +10:00
Keith Packard
955d434f4d Update to version 1.3.99.902 (1.14 RC2)
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-02-13 21:39:37 -08:00
Keith Packard
bd91b05b63 Update to version 1.13.99.901 (1.14 RC1)
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-12-19 12:47:35 -08:00
Peter Hutterer
938187f2fe Require inputproto 2.2.99.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2012-12-17 15:03:49 +10:00
Yaakov Selkowitz
54ba26cb1f os: Add libnettle as a choice of SHA1 implementation
libnettle is smaller than libgcrypt, currently being released more
frequently, and has replaced the latter in gnutls-3.x (which is used
by TigerVNC, so they can avoid pulling in two crypto libraries
simultaneously).

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2012-11-05 13:34:18 -06:00
Yaakov Selkowitz
cc1d8fa8a4 Configure fixes for MinGW
As for Cygwin, define FD_SETSIZE for uses of select() to be correct.
Link with libpthread.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-10-27 14:12:11 +01:00