Commit Graph

16046 Commits

Author SHA1 Message Date
Jason Gerecke
7d48b758a6 xwayland: Bind to wp_tablet_manager if available and get its seats
If we're notified about the existence of the wp_tablet_manager interface,
we bind to it so that we can make use of any tablets that are (or later
become) available. For each seat that exists or comes into existance at
a later point, obtain the associated tablet_seat.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <ping.cheng@wacom.com>
2017-04-28 11:21:24 +10:00
Jason Gerecke
89c841915a xwayland: Depend on wayland-protocols to build tablet protocol headers
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <ping.cheng@wacom.com>
2017-04-28 11:21:24 +10:00
Adam Jackson
59554eaa6c meson: Build libvbe.so
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-04-27 15:19:45 -04:00
Adam Jackson
2f1a1be46c meson: Build libshadowfb.so
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-04-27 15:19:44 -04:00
Adam Jackson
bdce17959c meson: Build libvgahw.so
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-04-27 15:19:41 -04:00
Adam Jackson
5c7d92362b meson: Build libfbdevhw.so
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-04-27 15:19:39 -04:00
Adam Jackson
6413a87bcd meson: Build libwfb.so
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-04-27 15:19:36 -04:00
Adam Jackson
1597297067 meson: Build libglx.so
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-04-27 15:19:34 -04:00
Adam Jackson
47f047462d meson: Fix linking the dmx utilities
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-04-27 15:19:31 -04:00
Adam Jackson
5d785693a8 meson: Factor out the AC_REPLACE_FUNCS stuff to its own library
This is all just stuff we wish we had in libc, and some of this gets
used in eg. the dmx utilities build, so split it to its own library to
avoid pulling in xserver stuff.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-04-27 15:19:29 -04:00
Adam Jackson
8659aac2cc meson: Fix a typo
"bulid" isn't valid anything, and build_xwayland was already defined
above.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-04-27 15:19:16 -04:00
Karol Kosik
112d0d7d01 xfree86: Improved autoconfig drivers matching
Implementation of new drivers matching algorithm. New approach
doesn't add duplicate drivers and ease drivers matching phase.

Signed-off-by: Karol Kosik <kkosik@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-04-27 15:10:56 -04:00
Eric Anholt
1549e30372 Add a Meson build system alongside autotools.
This is a work in progress that builds Xvfb, Xephyr, Xwayland, Xnest,
and Xdmx so far.  The outline of Xquartz/Xwin support is in tree, but
hasn't been built yet.  The unit tests are also not done.

The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools.  meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.

v2: Fix indentation nits, move version declaration to project(), use
    existing meson_options for version-config.h's vendor name/web.

Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-26 15:25:27 -07:00
Eric Anholt
c7be7a688a Use #ifdef instead of #if for features to make Meson easier.
We mostly use #ifdef throughout the tree, and this lets the generated
config.h files just be #define TOKEN instead of #define TOKEN 1.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-04-26 17:30:12 -04:00
Eric Anholt
ace6bfd590 dix: Remove a redundant #define
Found when the meson conversion set the symbol to defined, instead of
defined to 1.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-04-26 17:29:44 -04:00
Michel Dänzer
27a6b9f7c8 os: Handle SIGABRT
Without this, assertion failures can make life hard for users and those
trying to help them.

v2:
* Change commit log wording slightly to "can make life hard", since
  apparently e.g. logind can alleviate that somewhat.
* Set default handler for SIGABRT in
  hw/xfree86/common/xf86Init.c:InstallSignalHandlers() and
  hw/xquartz/quartz.c:QuartzInitOutput() (Eric Anholt)

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2017-04-26 16:07:19 -04:00
Eric Anholt
23f2f1932a modesetting: Add the "DPI" connector type.
The number for it was merged to drm_mode.h in kernel 4.7, and the
output_names[] array just requires that we slot in new strings in
order.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-04-25 15:01:23 -07:00
Eric Anholt
fec9607c8e Remove support for unaligned swaps.
The previous misc.h code went out of its way to allow swapping of
unaligned pointers to values.  However, the members of an X
request/response are always naturally aligned within the struct, and
the buffers containing a request/response will also be aligned to at
least 8 bytes, so we can just drop it.

        text      data   bss    dec      hex    filename
before: 2215167	  51552	 132016	2398735	 249a0f	hw/xfree86/Xorg
after:  2214919	  51552	 132016	2398487	 249917	hw/xfree86/Xorg

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-04-25 15:01:23 -07:00
Eric Anholt
4552238960 Add unit tests for the byte swapping macros.
Peter noted a weirdness in my new bswap code, which could use some
tests to justify it.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-25 15:01:23 -07:00
Eric Anholt
563b6ee873 Rewrite the byte swapping macros.
The clever pointer tricks were actually not working, and we were doing
the byte-by-byte moves in general.  By just doing the memcpy and
obvious byte swap code, we end up generating actual byte swap
instructions, thanks to optimizing compilers.

         text	   data	    bss	    dec	    hex	filename
before: 2240807	  51552	 132016	2424375	 24fe37	hw/xfree86/Xorg
after:  2215167	  51552	 132016	2398735	 249a0f	hw/xfree86/Xorg

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-04-25 15:01:23 -07:00
Eric Anholt
5ef4e78513 Remove default defines of some directories.
The build defines these, so having the defaults is just a way for the
build system's configuration to get out of sync with the code.

v2: Drop #ifndefs around the other two defines.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-04-25 15:01:23 -07:00
Eric Anholt
da27ca84b4 xorg: Change __XCONFIGFILE__ to XCONFIGFILE (and DIR) to fix scan.c.
parser/scan.c was checking for #ifdef XCONFIGFILE and XCONFIGDIR and
defaulting to "xorg.conf", and "xorg.conf.d", so if you had changed
__XCONFIGFILE__ to anything else, it would have got out of sync.
Settle on the name without gratuitous underscores.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-04-25 15:01:23 -07:00
Alan Coopersmith
f81343dd2f Mark test_data static in Xinput protocol tests to avoid clashes
Fixes warning from Solaris linker:
ld: warning: symbol 'test_data' has differing sizes:
    (file tests-protocol-xigetselectedevents.o value=0x418;
     file tests-protocol-xigetclientpointer.o value=0x18);
    tests-protocol-xigetselectedevents.o definition taken

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-24 11:05:04 +10:00
Olivier Fourdan
7bfb87a213 glamor: an FBO is not needed for Xv pixmaps
It appears that on some hardware/diver combo such as nv30/nouveau, using
GL_ALPHA as format for 8-bit depth will cause an incomplete attachment
error (GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT) when trying to bind the
texture.

As a result, the FBO is NULL and glamor segfaults when trying to access
the FBO width/height in pixmap_priv_get_scale() in glamor_xv_render().

This happens with glamor-xv which uses 8-bit pixmaps, meaning that on
such hardware/driver, trying to play a video using Xv will lead to a
crash of the Xserver. This affects Xwayland, Xephyr, modesetting driver
with glamor accel.

But the use of an FBO is not actually needed for glamox-xv, so by
disabling FBO at pixmap creation, we can avoid the issue entirely.

Fix suggested by Eric Anholt <eric@anholt.net>

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=100710
Fixes: https://bugzilla.redhat.com/1412814
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-04-21 11:53:13 -07:00
Eric Anholt
be80a3cb48 glx: Use the same endian swapping as the rest of the server.
This dumps a ton of configure-time checks for system endian macros.
Given that we're marking the mixed-endian fixup code as cold, getting
at the system macros is a waste of code.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-04-21 11:39:10 -07:00
Eric Anholt
dae97e1bb4 configure: Stop checking for XdmcpWrap
As far back as the initial import, it seems to have been exposed, and
there's no explanation why the test happened in the initial xserver
import.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-04-21 11:39:10 -07:00
Roman Gilg
cc882af336 xwayland: Small comment edit
Be more precise in describing the return value.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-18 12:36:55 +10:00
Michel Dänzer
41dafcc2a2 xfree86/modes: Make colormap/gamma glue code work with RandR disabled
E.g. because Xinerama is enabled.

Fixes crash on startup and wrong colours in that case.

Bugzilla: https://bugs.freedesktop.org/100293
Bugzilla: https://bugs.freedesktop.org/100294
Fixes: 62f4405257 ("xfree86/modes: Move gamma initialization to
                      xf86RandR12Init12 v2")
Tested-by: Mariusz Bialonczyk <manio@skyboo.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-04-17 16:12:32 +09:00
Martin Peres
bcee1b76aa modesetting: re-set the crtc's mode when link-status goes BAD
Despite all the careful planning of the kernel, a link may become
insufficient to handle the currently-set mode. At this point, the
kernel should mark this particular configuration as being broken
and potentially prune the mode before setting the offending connector's
link-status to BAD and send the userspace a hotplug event. This may
happen right after a modeset or later on.

Upon receiving a hot-plug event, we iterate through the connectors to
re-apply the currently-set mode on all the connectors that have a
link-status property set to BAD. The kernel may be able to get the
link to work by dropping to using a lower link bpp (with the same
display bpp). However, the modeset may fail if the kernel has pruned
the mode, so to make users aware of this problem a warning is outputed
in the logs to warn about having a potentially-black display.

This patch does not modify the current behaviour of always propagating
the events to the randr clients. This allows desktop environments to
re-probe the connectors and select a new resolution based on the new
(currated) mode list if a mode disapeared. This behaviour is expected in
order to pass the Display Port compliance tests.

Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-04-12 11:00:10 -07:00
Daniel Stone
ea91996a9c README: Add link to fd.o CoC
The Contributor Covenant applies to all fd.o-hosted resources, including
lists and Bugzilla. Add a note to the README, reminding people to act
like human beings.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
2017-04-11 08:51:34 -04:00
Daniel Stone
8bdf340e47 README: HTTPS everywhere
All fd.o HTTP services are now HTTPS-only (with redirects, but still).

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
2017-04-11 08:51:31 -04:00
Adam Jackson
14d2fe74f4 xephyr: Check for host XVideo support before trying to use it
Otherwise xcb will treat our attempt to send xv requests as a connection
error (quite reasonably: we're asking it to emit a request for which
there is no defined major opcode), and we'll die quietly the first time
we hit KdBlockhandler.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-04-10 14:10:02 -04:00
Adam Jackson
7dfb9608d0 glx: Remove enter/leave server API
Dead code since:

    commit 8aacf47e17
    Author: Adam Jackson <ajax@redhat.com>
    Date:   Fri Oct 4 12:58:19 2013 -0400

        glx: Remove DRI1 AIGLX (v2)

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-04-10 13:55:11 -04:00
Daniel Stone
0c8e6ed858 modesetting: Set correct DRM event context version
DRM_EVENT_CONTEXT_VERSION is the latest context version supported by
whatever version of libdrm is present. modesetting was blindly asserting
it supported whatever version that may be, even if it actually didn't.

With libdrm 2.4.78, setting a higher context version than 2 will attempt
to call the page_flip_handler2 vfunc if it was non-NULL, which being a
random chunk of stack memory, it might well have been.

Set the version as 2, which should be bumped only with the appropriate
version checks.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
2017-04-07 09:57:54 -04:00
Adam Jackson
e4d0757fc2 xfree86: Remove driver entity hooks and private
No driver is using these, as far as I know.

v2: Tripwire the entity hook arguments to xf86Config*Entity, fix
documentation (Eric Anholt)

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-03-30 11:32:02 -04:00
Adam Jackson
3360418767 dpms: Consolidate a bunch of stuff into Xext/dpms.c
Most of this is a legacy of the old "extmod" design where you could load
_some_ extensions dynamically but only if the server had been built with
support for them in the first place.

Note that since we now only initialize the DPMS extension if at least
one screen supports it, we no longer need DPMSCapableFlag: if it would
be false, we would never read its value.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-03-27 15:59:47 -04:00
Adam Jackson
7f1ef9289d dix: Lift DPMS to a screen hook
Following on from the previous change, this adds a DPMS hook to the
ScreenRec and uses that to infer DPMS support. As a result we can drop
the dpms stub code from Xext.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-03-27 15:59:42 -04:00
Adam Jackson
8ed0b00fce xfree86: Clean up DPMS support
Rather than setting up a per-screen private, just conditionally
initialize ScrnInfoRec::DPMSSet based on the config options, and inspect
that to determine whether DPMS is supported.

We also move the "turn the screen back on at CloseScreen" logic into the
DPMS extension's (new) reset hook. This would be a behavior change for
the non-xfree86 servers, if any of them had non-stub DPMS support.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-03-27 15:59:35 -04:00
Tobias Stoeckmann
21eda7464d dmx: Fix null pointer dereference
A null pointer dereference can occur in dmxSync, because TimerForce
does not handle a null pointer.

dmxSyncTimer is set to NULL a few lines above on a certain condition,
which happened on my machine. The explicit NULL check allowed me to
start Xdmx again without a segmentation fault.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-03-27 15:49:30 -04:00
Matt Turner
5cdfcdef81 xkb: Correct type of XkbDfltAccessXOptions.
Declared as unsigned short in xkb/xkbAccessX.c.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-27 13:22:33 +10:00
Adam Jackson
f4b78286ea glx: Fix MakeCurrent with no drawables
GLX_ARB_create_context, which we aspire to support, allows making GL 3.0
or newer contexts current with null current drawables. Strictly this
might not be legal for pre-3.0 contexts, but there's no harm in allowing
it anyway.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-03-24 11:49:14 -04:00
Eric Anholt
e2e50c5097 xserver: Unifdef HAVE_CONFIG_H
The X Server never generates a global config.h, and instead all these
paths are including dix-config.h or xorg-config.h.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-03-23 13:19:51 -04:00
Eric Anholt
266af991c8 glamor: Fix some formatting that confused the unifdef command.
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-03-23 13:17:42 -04:00
Eric Anholt
2da405759f xserver: Check the right HAVE_*_CONFIG_H.
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-03-23 13:17:39 -04:00
Eric Anholt
190c2adf4a kdrive: Drop kdrive-config.h.
It had nothing left in it that was used but wasn't in dix-config.h.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-03-23 13:17:36 -04:00
Eric Anholt
5c7ed785e3 kdrive: Remove vestiges of TSLIB support.
The actual code was gone in 27819950e4,
but some checks remained.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-03-23 13:17:34 -04:00
Eric Anholt
1b1a8c4817 kdrive: Unifdef KDRIVE_EVDEV.
ajax deleted the evdev driver in the removal of fbdev and the linux
backend.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-03-23 13:14:13 -04:00
Mariusz Bialonczyk
ad6689b7db configure.ac: fix checking for libdrm version after 9232835bd
No matter what libdrm version was installed, it always set
the GLAMOR_HAS_DRM_NAME_FROM_FD_2 conditional to 1.
This obviously leads to compilation problems.

Fixes: 9232835bd1 ("glamor: use drmGetDeviceNameFromFD2 when available")
Signed-off-by: Mariusz Bialonczyk <manio@skyboo.net>
Reviewed-and-Tested-by: Qiang Yu <Qiang.Yu@amd.com>
2017-03-23 18:16:57 +09:00
Michel Dänzer
eb2cf11724 Xephyr: Handle source-only pictures in ephyrPrepare/DoneComposite
There is no pixmap associated with source-only pictures.

Fixes Xephyr -fakexa crashing on startup.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-23 15:28:55 +10:00
Michel Dänzer
fdc79fe72b edid: Prune duplicates after adding modes from DDC
Multiple calls to xf86EdidMonitorSet (which can be triggered e.g. by
running xrandr) would potentially keep adding the same modes, causing
the Monitor->Modes list to keep growing larger and using up more memory.

Fix this by calling xf86PruneDuplicateModes after adding the modes
returned by xf86DDCGetModes. This makes sure there's only one instance
of each unique mode in the list.

v2:
* Replace semicolon with {} for empty for loop (Emil Velikov)
* Slightly tweak commit log to avoid minor inaccuracy about what
  xf86PruneDuplicateModes does

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99521
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-21 12:31:16 -04:00