Commit Graph

16055 Commits

Author SHA1 Message Date
Eric Anholt
59de50d6ef glamor_egl: Avoid flink names in glamor_egl_create_textured_pixmap().
Using flink is banned on render nodes, and they needlessly expose our
screen pixmap contents to any authenticated client.  This also
incidentally drops the dependency on EGL_MESA_drm_image.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-05-18 11:33:26 -04:00
Eric Anholt
5d6f17d913 glamor_egl: Drop dead "cpp" field
It's been unused since the initial import.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-05-18 11:33:24 -04:00
Eric Anholt
37618e810b glamor_egl: Drop dead gl_context_depth.
This was replaced in 4afe15d8bf, but not
deleted.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-05-18 11:33:21 -04:00
Eric Anholt
a6a751e5d8 glamor_egl: Drop unnecessary check for KHR_gl_renderbuffer_image.
I couldn't find it being used anywhere in the history of the code.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-05-18 11:33:18 -04:00
Eric Anholt
40a153ee45 glamor_egl: Always require the gbm-based image import path.
This has been associated with dri3 for now, but we need to use it
elsewhere in order to avoid flink.  The extensions have been
implemented for long enough that I couldn't find when it was that we
turned them on.  Oddly, we already required renderbuffer import
support, which is basically as hard to implement as texture import.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Daniel Stone <daniels@collabora.com>
2017-05-18 11:33:09 -04:00
Eric Anholt
b1b71b7a8b glamor_egl: Drop the has_gem flag.
We're using GBM, so we know we've got GEM.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-05-18 11:33:07 -04:00
Eric Anholt
32957d9fae modesetting: Drop code for GLAMOR && !GLAMOR_HAS_GBM.
The glamor_egl module that the GLAMOR paths are using is only built if
GLAMOR_HAS_GBM is true, and there's no plan for implementing the
module without GBM.  Simplify modesetting's code as a result.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-05-18 11:33:05 -04:00
Eric Anholt
5102ea38eb glamor_egl: Unifdef GLAMOR_HAS_GBM.
We only build this code with GBM, and supporting non-GBM well would be
invasive.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-05-18 11:33:03 -04:00
Eric Anholt
5064153c79 glamor_egl: Print a useful identifying string on initialization.
The EGL version is not used anywhere in the glamor code, so it's not
interesting.  And when saying that we've started using GL
acceleration, it's nice to know what GL we're actually using.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-05-18 11:32:59 -04:00
Jon Turney
fd96ff7fb3 hw/xwin: Fix -Wunused-function warning for MessageName() in non-debug builds
../hw/xwin/winmultiwindowwm.c:188:1: warning: ‘MessageName’ defined but not used [-Wunused-function]

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2017-05-15 17:46:37 -04:00
Jon Turney
e49f5947ed hw/xwin: Fix -Wmaybe-uninitialized warnings in engine CloseScreen wrappers
../hw/xwin/winshadgdi.c: In function ‘winCloseScreenShadowGDI’:
../hw/xwin/winshadgdi.c:632:12: warning: ‘fReturn’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../hw/xwin/winshadgdi.c:579:10: note: ‘fReturn’ was declared here
../hw/xwin/winshadddnl.c: In function ‘winCloseScreenShadowDDNL’:
../hw/xwin/winshadddnl.c:711:12: warning: ‘fReturn’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../hw/xwin/winshadddnl.c:661:10: note: ‘fReturn’ was declared here

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2017-05-15 17:46:18 -04:00
Jon Turney
319daa7a9f hw/xwin: Fix -Wmaybe-uninitialized warning in winWindowProc
This is possibly an actual bug in failing to check we successfully retrieved
the monitor size before using it to set the X screen size.

../hw/xwin/winwndproc.c: In function ‘winWindowProc’:
../hw/xwin/winwndproc.c:283:55: warning: ‘dwHeight’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../hw/xwin/winwndproc.c:240:32: note: ‘dwHeight’ was declared here
../hw/xwin/winwndproc.c:281:54: warning: ‘dwWidth’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../hw/xwin/winwndproc.c:240:23: note: ‘dwWidth’ was declared here

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2017-05-15 17:46:07 -04:00
Jon Turney
7a90c9b24e xfree86: Hide unused variables when !XSERVER_LIBPCIACCESS
../hw/xfree86/common/xf86Config.c: In function ‘xf86HandleConfigFile’:
../hw/xfree86/common/xf86Config.c:2278:10: warning: unused variable ‘singlecard’ [-Wunused-variable]
../hw/xfree86/common/xf86Config.c:2277:17: warning: unused variable ‘scanptr’ [-Wunused-variable]

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2017-05-15 17:45:14 -04:00
Peter Hutterer
7a19a3e093 xfree86: build a shared lib identical to Xorg
Because we can use a shared lib in dlsym() for the symbol loader test,
but we can't use the executable.

v2: Drop a stray ' ' and rebase on 820a4cbe9f, by anholt

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-15 09:14:42 -07:00
Adam Jackson
49c7425574 meson: Fix CLOCK_MONOTONIC test
C99 isn't enough on its own to get POSIX feature sets defined.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-05-12 09:49:33 -04:00
Adam Jackson
152375f4e4 os, xfree86: Stop being so weird about <limits.h>
Whatever problem this is trying to fix, we don't care. Just include the
thing and stop worrying about whether _POSIX_SOURCE is defined.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-05-12 09:49:07 -04:00
Keith Packard
d9e23ea422 dix: Remove clients from input and output ready queues after closing
Delay removing the client from these two queues until all potential
I/O has completed in case we mark the client as ready for reading or
with pending output during the close operation.

Bugzilla: https://bugs.freedesktop.org/100957
Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Nick Sarnie <commendsarnex@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-05-12 00:21:16 -07:00
Julien Cristau
c394f6b273 Replace all checks for 'linux' macro with '__linux__'
gcc -std=c99 does not define the former, and it's a horrible namespace
confusion anyway.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-05-11 15:24:05 -04:00
Julien Cristau
6634ffc4d2 Drop workaround for pre-glibc linux
It seems unlikely anyone still needs to build against libc4/libc5.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2017-05-11 15:24:01 -04:00
Frank Binns
3182570295 hw/xfree86: fix comment typo
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
2017-05-11 15:22:41 -04:00
Adam Jackson
0848390d51 xephyr: Fix regeneration
I had said:

    commit c42311a9d7
    Author: Adam Jackson <ajax@redhat.com>
    Date:   Fri Mar 24 15:58:54 2017 -0400

        kdrive: Remove KdOsFuncs

        Only the Init slot was used, and Xephyr can just as easily do
        that initialization directly.

And I'd've been right, but I forgot to make that initialization only
happen on startup (i.e. when serverGeneration == 1).

Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-05-11 14:13:12 -04:00
Peter Harris
0ff2fb128b meson: Detect strlcat/strlcpy/reallocarray in libbsd
If we're linking with libbsd anyway, we might as well use the functions
it provides instead of compiling our replacements.

Signed-off-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-10 15:08:27 -04:00
Peter Harris
c4c002d1ca meson: Only detect each function once
Use conf_data outside of include/ to avoid re-running detection of the
same functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Peter Harris <pharris@opentext.com>
2017-05-10 15:08:25 -04:00
Peter Harris
03d6275e60 meson: Detect more functions
Set HAVE_REALLOCARRAY, HAVE_SIGACTION, HAVE_STRCASESTR, HAVE_STRLCAT,
HAVE_STRLCPY, HAVE_TIMINGSAFE_MEMCMP, and BUSFAULT.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Peter Harris <pharris@opentext.com>
2017-05-10 15:08:23 -04:00
Peter Harris
ba1599610b meson: Detect arc4random_buf
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Peter Harris <pharris@opentext.com>
2017-05-10 15:08:16 -04:00
Jon TURNEY
e67ca94047 meson: An empty array is not a dependency object
Using the meson idiom of initializing a variaible to an empty array to
represent a null value does not work well for a variable expected to hold a
dependency object, as trying to apply found() to it will fail (currently).

I think this can be demonstrated by configuing with Dglamor=no, then gbm_dep
is set to [] in meson.build, and then tested with found() in
include/meson.build.

Use dependency('') to create an empty dependency.

Future work: In the autotools build GBM is required if build_xorg &
build_glamor.  I suspect that it was also required for build_xwayland &
build_glamor, but that was never checked.  That test seems to have gone
missing in meson.build, the required:false when checking for gbm should
possibly be dropped?

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-10 14:43:52 -04:00
Jon TURNEY
16054647ab meson: Refine build_dbus
As in autotools build, only turn on build_dbus (build dbus-core.c) if it's
needed by build_hal or build_systemd_logind, not just because dbus is
available.

Building dbus-core.c without NEED_DBUS defined fails, as the contents of
dbus-core.h are turned off.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Acked-by: Eric Anholt <eric@anholt.net>
2017-05-10 14:43:48 -04:00
Jon TURNEY
820a4cbe9f meson: Make driprotos and libdrm optional
Add options for DRI{1,2,3}
shmfence is required for DRI3
libdrm is required for any DRI{1,2,3}
Consolidate calls to dependency('libdrm')
Set WITH_LIBDRM when building with libdrm

v2:
Initialize libxserver_dri3 to []
Manually flatten libxserver, since meson doesn't (currently)
Use version_compare rather than circumloctions with dependency()

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-10 14:43:13 -04:00
Jon TURNEY
fdb11e2274 meson: Don't require xf86dgaproto
This dependency is never used, and build_dga is hardwired to false later on,
anyhow.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-05-10 14:43:11 -04:00
Jon TURNEY
5bff2a6856 meson: Nettle is required if it's the only SHA1 choice
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-05-10 14:43:08 -04:00
Jon TURNEY
95e5fa0476 meson: Remove stray whitespace
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-05-10 14:43:01 -04:00
Adam Jackson
e9dbecf7c2 timingsafe_memcmp: Fix meson build
Include dix-config.h first to pick up _GNU_SOURCE so we get the
definition for sigset_t.

Reported-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-05-10 10:56:16 -04:00
Karol Kosik
5d3b6cc221 xfree86: Improved autoconfig drivers matching
Implementation of new drivers matching algorithm. New approach
doesn't add duplicate drivers and ease drivers matching phase.

v2: Re-commit the patch reverted in
    2388f5e583, with Aaron Plattner's
    fix squashed in (by anholt).

Signed-off-by: Karol Kosik <kkosik@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com> (v1)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (v1)
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Eric Anholt <eric@anholt.net>
2017-05-09 17:36:05 -07:00
Eric Anholt
2388f5e583 Revert "xfree86: Improved autoconfig drivers matching"
This reverts commit 112d0d7d01.

It broke Xorg for Adam, Peter, and myself, by failing hard when a
module load failed.

Signed-off-by: Eric Anholt <eric@anholt.net>
2017-05-09 15:02:30 -07:00
Eric Anholt
1dd14e7a49 meson: Use link_whole() not link_with(), for the Xorg dixmods.
I clearly hadn't run ninja test, since fb no longer had any of the fb
symbols in it.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-09 10:52:26 -07:00
Lyude
a06bb73053 xwayland: Unconditionally initialize lists in init_tablet_manager_seat()
In the event that xwayland gets launched on a wayland compositor that
doesn't yet have support for wp_tablet_manager, we end up skipping the
initialization of the lists. This is wrong, because regardless of
whether or not a tablet is present we still attempt to traverse these
lists later in xwl_set_cursor(), expecting that if the lists are empty
from no tablet manager that we simply won't execute any loop iterations.

(EE)
(EE) Backtrace:
(EE) 0: Xwayland (OsSigHandler+0x3b) [0x4982f9]
(EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x7f73722545bf]
(EE) 2: Xwayland (xwl_set_cursor+0x9f) [0x429974]
(EE) 3: Xwayland (miPointerUpdateSprite+0x261) [0x4fe1ca]
(EE) 4: Xwayland (mieqProcessInputEvents+0x239) [0x4f8d33]
(EE) 5: Xwayland (ProcessInputEvents+0x9) [0x4282f0]
(EE) 6: Xwayland (Dispatch+0x42) [0x43e2d4]
(EE) 7: Xwayland (dix_main+0x5c9) [0x44c6dc]
(EE) 8: Xwayland (main+0x28) [0x61c523]
(EE) 9: /lib64/libc.so.6 (__libc_start_main+0xf1) [0x7f7371e9d401]
(EE) 10: Xwayland (_start+0x2a) [0x4208fa]
(EE) 11: ? (?+0x2a) [0x2a]
(EE)
(EE) Segmentation fault at address 0x28
(EE)
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE)

Reproduced when trying to run upstream xwayland under fedora 25's weston
package.

Signed-off-by: Lyude <lyude@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-05 08:50:45 +10:00
Jon TURNEY
5f83b951ac meson: Fix typo in xephyr option description
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-05-04 10:28:21 -04:00
Jon TURNEY
ce6741f6ac meson: Fix typoed filename
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-05-04 10:28:18 -04:00
Jon TURNEY
4925348133 meson: Make xf86vidmode optional
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-05-04 10:28:15 -04:00
Jon TURNEY
3b3ce4a55b meson: Test to build xserver_poll.c was inverted
Test to build xserver_poll.c was inverted compared to autoconf. Build
xserver_poll.c if poll is missing.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-05-04 10:28:08 -04:00
Adam Jackson
4b7dd6d1aa Makefile.am: make 'make distcheck' verify the meson build
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-04 11:06:34 +10:00
Peter Hutterer
111a5615a6 Makefile.am: add the meson files to the tarball
While we're shipping both build systems, we'll likely have 'make dist'
generated tarballs - those tarballs should be buildable with meson to
have more exposure. List them all explicitly since the list isn't likely
to change much.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-04 11:06:05 +10:00
Eric Anholt
11c133aafe meson: Fix kdrive build.
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-05-04 11:04:40 +10:00
Adam Jackson
b7376fb933 kdrive: Remove dead slots from KdCardFuncs
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-03 16:01:25 -04:00
Adam Jackson
c42311a9d7 kdrive: Remove KdOsFuncs
Only the Init slot was used, and Xephyr can just as easily do that
initialization directly.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-05-03 16:00:54 -04:00
Adam Jackson
c0375dced3 kdrive: static and dead code cleanup
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-05-03 16:00:52 -04:00
Adam Jackson
d732c36597 xfree86: Silence a new glibc warning
glibc would like to stop declaring major()/minor() macros in
<sys/types.h> because that header gets included absolutely everywhere
and unix device major/minor is perhaps usually not what's expected. Fair
enough. If one includes <sys/sysmacros.h> as well then glibc knows we
meant it and doesn't warn, so do that if it exists.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-05-03 15:44:06 -04:00
Adam Jackson
c3147a2006 dmx: Fix decl mismatch for XRT_WINDOW
Building xserver with meson -Db_lto=true found this! Check it:

../hw/dmx/dmx.c:66:22: warning: type of ‘XRT_WINDOW’ does not match
                                original declaration [-Wlto-type-mismatch]
 extern unsigned long XRT_WINDOW;
                      ^
../include/resource.h:58:18: note: type ‘RESTYPE’ should match type ‘long
                                   unsigned int’
 typedef uint32_t RESTYPE;
                  ^
../Xext/panoramiX.c:85:9: note: ‘XRT_WINDOW’ was previously declared here
 RESTYPE XRT_WINDOW;
         ^
../Xext/panoramiX.c:85:9: note: code may be misoptimized unless
                                -fno-strict-aliasing is used

I have never managed successfully to build xserver with LTO with
autotools, so, score one for meson.

Get the decl from panoramiXsrv.h, which includes panoramiX.h first anyway.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-05-03 15:44:04 -04:00
Eric Anholt
ea275cd3d5 meson: Fix glx build with DRI2 disabled.
A common meson pattern is to use empty arrays for optional sources and
dependencies, since it generally iterates over trees of arrays looking
for values.  A value of '' will actually go looking for ''.

Daniel Stone <daniels@collabora.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-05-03 14:52:39 -04:00
Eric Anholt
62f727c7ea meson: use link_with for Xorg's shared modules as well as Xorg.
I converted Xorg when meson 0.40 came out, but fumbled my grep and
forgot that I had instances of the .extract_all_objects() workaround
in dixmods, too.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-05-03 14:52:19 -04:00