Commit Graph

16143 Commits

Author SHA1 Message Date
Eric Anholt
e8f190b445 travis: Request a new docker image with xkb-data and xkbcomp installed.
Xvfb was erroring out with:

XKB: Failed to compile keymap
Keyboard initialization failed. This could be a missing or incorrect
setup of xkeyboard-config.
(EE) Fatal server error:
(EE) Failed to activate virtual core keyboard: 2(EE)

With this change, we can now run my xsync regression test on Travis.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-08-11 11:02:54 -04:00
Eric Anholt
b62e486c4e travis: Set prefix to /usr, so we find xkbcomp.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-08-11 11:02:51 -04:00
Eric Anholt
2d50e32e0b meson: Fix xwayland build since xwayland-keyboard-grab.
The version detect was erroring out with 1.9 protos installed, and we
weren't building the new code.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-02 09:39:04 +01:00
Olivier Fourdan
0a448d133f xwayland: Add grab protocol support
The keyboard grabbing protocol for Xwayland is included in
wayland-protocol 1.9.

Update the wayland-protocol required version in both configure and meson
builds and add support for this new protocol in Xwayland.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-01 10:56:42 +01:00
Jan Beich
abe49b0090 dix: unbreak --with-dtrace (default) on FreeBSD 11.1+
gmake[2]: Entering directory '/path/to/xserver/dix'
/usr/sbin/dtrace -G -C -o dtrace-dix.o -s ../dix/Xserver.d .libs/atom.o ...
dtrace: failed to compile script ../dix/Xserver.d: line 26: useless declaration
gmake[2]: *** [Makefile:1007: dtrace-dix.o] Error 1

Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-07-31 13:32:35 -04:00
Emil Velikov
c967e4cd8b glx: don't export __glXDRISWRastProvider
The symbol is used only internally and is not part of the API/ABI.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-07-31 13:25:30 -04:00
Emil Velikov
c09e906d61 glx: fix typo becuase -> because
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-07-31 13:25:24 -04:00
Adam Jackson
db0dd06ddf glx: Allow arbitrary context attributes for direct contexts
For direct contexts, most context attributes don't require any
particular awareness on the part of the server. Examples include
GLX_ARB_create_context_no_error and GLX_ARB_context_flush_control, where
all of the behavior change lives in the renderer; since that's on the
client side for a direct context, there's no reason for the X server to
validate the attribute.

The context attributes will still be validated on the client side, and
we still validate attributes for indirect contexts since the server
implementation might need to handle them. For example, the indirect
code might internally use ARB_context_flush_control for all contexts, in
which case it would need to manually emit glFlush when the client
switches between two indirect contexts that didn't request the no-flush
attribute.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-07-31 10:59:09 -04:00
Adam Jackson
3050d27761 xfree86: Fix X -configure driver sort yet again
There were two bugs here: The comparison function was not stable when
one or more of the drivers being compared is a fallback, and the last
driver in the list would never be moved.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-07-31 10:57:22 -04:00
Adam Jackson
6f9939525c modesetting: Fix PCI initialization on non-zero domains
libdrm's busid matching for the legacy three-integer bus string format
simply ignores the domain number, rather than what we were doing here of
packing the domain into the bus number. Whatever, just use the existing
code to build a busid string, since that gets the domain right.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-07-31 10:55:52 -04:00
Jeremy Huddleston Sequoia
d16133e3e2 glx: Only include compositeext.h if COMPOSITE is supported
Regressed-in: ea483af99a
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2017-07-20 19:51:19 -07:00
Jeremy Huddleston Sequoia
dd0b721c97 XQuartz: Hack around an issue that can occur on macOS due to background apps incorrectly stealing focus
Works around <rdar://problem/7150340>.

Tested-by: Martin Otte <martinjotte@gmail.com>
Tested-by: Tom Lane <tgl@sss.pgh.pa.us>
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2017-07-20 01:17:40 -07:00
Michal Srb
211e05ac85 Xi: Test exact size of XIBarrierReleasePointer
Otherwise a client can send any value of num_barriers and cause reading or swapping of values on heap behind the receive buffer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-11 12:34:19 +10:00
Rodrigo Vivi
abb031e731 dri2: Sync i965_pci_ids.h from Mesa.
Copied from Mesa with no modifications.

Gives us Coffee Lake and Cannon Lake PCI IDs.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2017-07-06 11:50:41 -07:00
Emil Velikov
05a4396f08 glamor: update "required EGL extensions" comment
The extensions listed have not been needed in a while. Replace with the
only remaining requirement.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-05 10:15:32 -04:00
Adam Jackson
04511a0476 wayland: Sync drm.xml with Mesa
... where it is named src/egl/wayland/wayland-drm/wayland-drm.xml and
has its requests sorted by protocol version number, avoiding a warning
from wayland-scanner.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-07-05 10:13:04 -04:00
Dave Airlie
ce393de0ef modesetting: handle NULL cursor in drmmode_set_cursor.
We had a bug reported with a touchscreen where we could end up
in here with a NULL cursor, so let's not crash the X server.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-and-Tested-by: Daniel Martin <consume.noise@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-04 17:45:16 +10:00
Peter Hutterer
43527d3181 xfree86: link to libinput(4) from the xorg.conf man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-07-04 17:44:32 +10:00
Adam Jackson
edaad0eff4 automake: Add hw/xfree86/xkb/meson.build to EXTRA_DIST
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-29 13:57:37 -04:00
Emil Velikov
06419a5b17 glamor: remove no longer needed KHR_gl_texture_2D_image requirement
The code that needed it was introduced with commit 7cfd9cc232 ("Add
DRI3 support to glamor") back in 2013. And was nuked a couple of years
ago with commit 51984dddfc ("glamor: Delay making pixmaps shareable
until we need to.")

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-06-29 08:48:25 -07:00
Jon TURNEY
47a7b63f74 meson: Use --export-all-symbols when building PE/COFF objects
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-06-27 12:42:51 -04:00
Jon TURNEY
b34abb3d2d meson: Shuffle around subdirs so we build Xorg loadable modules after Xorg
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-06-27 12:42:35 -04:00
Jon TURNEY
fbdd73fac6 Move statically linked xorgxkb files from dixmods to a separate directory
[ajax: Fixed test/Makefile.am as well]

Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-06-27 12:42:06 -04:00
Adam Jackson
5c8fb7d128 xfree86: Move DRICreatePCIBusID to xf86Pci.h
xf86str.h is parsed into sdksyms unconditionally but the symbol is only
defined when building with PCI support. Move the decl to a header that
sdksyms only parses when building PCI support.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-06-22 10:53:08 -04:00
Adam Jackson
525db17e04 glx/drisw: Use scratch GCs for swrastPutImage
The scratch GC defaults to the same state as our persistent GCs. Except
for the "draw" GC, which would generate graphics exposures for... well,
no reason really, PutImage doesn't generate graphics exposures.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-06-20 16:39:23 -04:00
Adam Jackson
ecc5e36298 glx/drisw: Remove unused glx_enable_bits
Sloppy of me!

Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Keith Packard <keithp@keithp.com>
2017-06-20 16:39:23 -04:00
Adam Jackson
a6c23ef31a glx/dri2: Don't chirp when falling back to software
This isn't an error if the screen isn't accelerated in the first place.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Keith Packard <keithp@keithp.com>
2017-06-20 16:39:23 -04:00
Adam Jackson
0b1831d043 glx: Remove some indirection around EXT_texture_from_pixmap
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-06-20 16:39:23 -04:00
Adam Jackson
c33541e59e glx: Remove __glXReply
Static data bad, hulk smash.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-06-20 16:39:23 -04:00
Adam Jackson
d6db668116 dmx: Remove some not-very-interesting debug prints
gcc/glibc think the snprintf in dmxExecOS() might truncate. Yes, it
might, and we also don't care. Just delete all this.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Keith Packard <keithp@keithp.com>
2017-06-20 16:39:23 -04:00
Adam Jackson
17ad6e5d56 dmx: Silence an unused-result warning
Modern glibc is very insistent that you care about whether write()
succeeds:

../hw/dmx/input/usb-keyboard.c: In function ‘kbdUSBCtrl’:
../hw/dmx/input/usb-keyboard.c:292:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
         write(priv->fd, &event, sizeof(event));
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-06-20 16:39:23 -04:00
Adam Jackson
fbc4da6fef xfree86: Move DRICreatePCIBusID to the PCI code
This symbol is used by some DRI2+ drivers and there's nothing
DRI1-specific about it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Keith Packard <keithp@keithp.com>
2017-06-20 16:37:24 -04:00
Adam Jackson
b723da8390 xfree86: Remove unused xf86EnableVTSwitch
Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Keith Packard <keithp@keithp.com>
2017-06-20 16:37:24 -04:00
Adam Jackson
f44e0af4da dix: Remove extension aliases
This appears to be essentially unused. The only known client-side
library for the SELinux extension is xcb, which does not look for the
name "Flask". The "SGI-GLX" alias for GLX appears to be a bit of
superstition at this point, NVIDIA's driver does not expose it and Mesa
does not check for it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Keith Packard <keithp@keithp.com>
2017-06-20 16:37:24 -04:00
Adam Jackson
88e807d4fa include: Remove some unused macros
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-06-20 16:37:23 -04:00
Michel Dänzer
d2e57f71ad xfree86: Document BusID PCI domain format in ddxDesign.xml
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2017-06-20 16:31:50 -04:00
Michel Dänzer
3b0fd9421a xfree86: Document BusID PCI domain format in xorg.conf manpage
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2017-06-20 16:31:48 -04:00
Michel Dänzer
8e00dc59b5 xfree86: Fix printing of PCI domain/bus in xf86MatchPciInstances
It was attempting to use the <bus>@<domain> format accepted by the BusID
stanza, but the two values were swapped.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2017-06-20 16:31:45 -04:00
Michel Dänzer
e905b19a53 xfree86: Print BusID stanza compatible bus IDs for found devices
The PCI domain has to be specified like this:

 "PCI:<bus>@<domain>:<device>:<function>"

Example before:

 (--) PCI:*(0:0:1:0) 1002:130f:1043:85cb [...]
 (--) PCI: (0:1:0:0) 1002:6939:1458:229d [...]

after:

 (--) PCI:*(0@0:1:0) 1002:130f:1043:85cb [...]
 (--) PCI: (1@0:0:0) 1002:6939:1458:229d [...]

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2017-06-20 16:31:34 -04:00
Jon Turney
fb212f2c1b meson: Make VBE and VGAHW modules optional
Don't build them on platforms where they aren't meaningful.

Note that autoconf defines WITH_VGAHW when building the VGAHW module, but
that doesn't seem to be used anywhere, so we just drop that.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-06-20 13:07:20 +01:00
Jon Turney
6d2b7d3367 meson: Restore stub ossupport
Don't build BSD ossupport when there is no specific support, build stubs

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-06-20 13:06:41 +01:00
Michel Dänzer
4212c884c4 xfree86/modes: Use RRTransformEqual in xf86RandR12CrtcSet
The memcmp didn't catch when e.g. only the filter changed. Tested by
alternately running

xrandr --output DVI-I-0 --scale-from 3840x2160 --filter bilinear
xrandr --output DVI-I-0 --scale-from 3840x2160 --filter nearest

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2017-06-20 12:40:18 +09:00
Aaron Plattner
091af80be4 randr: Use RRTransformEqual in RRCrtcPendingTransform
Currently, RRCrtcPendingTransform returns false unless the
transformation matrix itself is changing. This makes RRCrtcSet skip
doing anything if the only thing that is changing is the transform
filter.

There's already a function for comparing RRTransformPtrs, so use that
instead.

Tested by running

  xrandr --output DP-1 --mode 1920x1080 --rate 144 --scale 0.5x0.5 --filter nearest

follwed by

  xrandr --output DP-1 --mode 1920x1080 --rate 144 --scale 0.5x0.5 --filter bilinear

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2017-06-19 17:49:41 +09:00
Michal Srb
ba336b2405 Xi: Do not try to swap GenericEvent.
The SProcXSendExtensionEvent must not attempt to swap GenericEvent because
it is assuming that the event has fixed size and gives the swapping function
xEvent-sized buffer.

A GenericEvent would be later rejected by ProcXSendExtensionEvent anyway.

Signed-off-by: Michal Srb <msrb@suse.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-19 11:58:56 +10:00
Michal Srb
8caed4df36 Xi: Verify all events in ProcXSendExtensionEvent.
The requirement is that events have type in range
EXTENSION_EVENT_BASE..lastEvent, but it was tested
only for first event of all.

Signed-off-by: Michal Srb <msrb@suse.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-19 11:58:54 +10:00
Michal Srb
215f894965 dix: Disallow GenericEvent in SendEvent request.
The SendEvent request holds xEvent which is exactly 32 bytes long, no more,
no less. Both ProcSendEvent and SProcSendEvent verify that the received data
exactly match the request size. However nothing stops the client from passing
in event with xEvent::type = GenericEvent and any value of
xGenericEvent::length.

In the case of ProcSendEvent, the event will be eventually passed to
WriteEventsToClient which will see that it is Generic event and copy the
arbitrary length from the receive buffer (and possibly past it) and send it to
the other client. This allows clients to copy unitialized heap memory out of X
server or to crash it.

In case of SProcSendEvent, it will attempt to swap the incoming event by
calling a swapping function from the EventSwapVector array. The swapped event
is written to target buffer, which in this case is local xEvent variable. The
xEvent variable is 32 bytes long, but the swapping functions for GenericEvents
expect that the target buffer has size matching the size of the source
GenericEvent. This allows clients to cause stack buffer overflows.

Signed-off-by: Michal Srb <msrb@suse.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-19 11:58:50 +10:00
Michal Srb
05442de962 Xi: Zero target buffer in SProcXSendExtensionEvent.
Make sure that the xEvent eventT is initialized with zeros, the same way as
in SProcSendEvent.

Some event swapping functions do not overwrite all 32 bytes of xEvent
structure, for example XSecurityAuthorizationRevoked. Two cooperating
clients, one swapped and the other not, can send
XSecurityAuthorizationRevoked event to each other to retrieve old stack data
from X server. This can be potentialy misused to go around ASLR or
stack-protector.

Signed-off-by: Michal Srb <msrb@suse.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-19 11:58:44 +10:00
Eric Anholt
d82c3cee02 travis: Enable ccache.
We bind-mount the cache directory into the container.  Cuts build time
from about 4 minutes to 2.

Signed-off-by: Eric Anholt <eric@anholt.net>
2017-06-13 10:38:39 -04:00
Eric Anholt
01dfb65ee2 travis: Add a build script for Travis CI.
This currently does a meson build using a docker image I've prepared.
The Dockerfile source is at:

    https://github.com/anholt/xserver-travis

Docker proved to be necessary to cut the build time per Travis push.
If some day we end up using meson in more of the X stack, we may be
able to move more dependencies out of the docker image and into the CI
build (putting the I in CI).  Until then, we'll have to do docker
image rebuilds when dependencies are added/updated.

To enable Travis CI on your github repository, see the first two steps
of the docs at:

    https://docs.travis-ci.com/user/getting-started/

Once you do that, pushing branches to your github repo will trigger
builds, which will send you email if they fail.  Current build status
can be veiewed your account on travis-ci.org:

    https://travis-ci.org/anholt/xserver
2017-06-13 10:36:25 -04:00
Eric Anholt
fda2b064a0 meson: Fix test for whether we've built glamor-EGL.
This matches the test we use for going into the glamor_egl subdir in
../../meson.build.
2017-06-13 10:36:18 -04:00