Commit Graph

17073 Commits

Author SHA1 Message Date
Jon Turney
965eda947d mi: Provide ffs when compiling using MinGW
I don't know how I feel about the promise made in 2e7f790b :)
2019-05-18 14:59:38 +00:00
Jon Turney
a838c840a3 os: Ensure sigset_t is provided when compiling for MinGW
Only _sigset_t is defined by MinGW's signal.h
2019-05-18 14:59:38 +00:00
Jon Turney
7b4b030df8 configure: Check for sigprocmask
MinGW defines SIG_BLOCK, but doesn't have signal masks, so rather than
checking for SIG_BLOCK, add a configure check for sigprocmask.

v2:
Also add check to meson.build
2019-05-18 14:59:38 +00:00
Jon Turney
6c5d048095 os: Fix build of xserver_poll.c on MinGW
Include winsock.h for definition of fd_set type and select()

Future work: Maybe this also needs some error checking for fd > FD_SETSIZE?
2019-05-18 14:59:38 +00:00
Jon Turney
246b729df8 configure: Force --disable-input-thread for MinGW
I don't think an input thread can ever be useful on Windows.

There is a pthread emulation, so having the thread itself isn't much of
a problem.

However, there is no device to wait on for Windows events, and even if
we were to replace select() with WFMO, Windows wants to send events for
a window to the thread which created that window.

So, disable input thread by default for MinGW

v2:
Also add similar to meson.build
2019-05-18 14:59:38 +00:00
Aaron Plattner
29a8baa031 Merge commit 'refs/merge-requests/194/head' of gitlab.freedesktop.org:xorg/xserver 2019-05-17 08:39:50 -07:00
Kyle Brenneman
56c0a71fdd GLX: Add a function to change a clients vendor list.
Add a new function, GlxServerExports::setClientScreenVendor, which will change
the vendor that handles GLX requests for a screen, but only for requests from
a specific client.

v2: Increment the GLXVND minor version number.
v3: Note the GLXVND version requirement for setClientScreenVendor.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2019-05-17 08:25:28 -07:00
Kyle Brenneman
8b67ec7cc6 GLX: Use the sending client for looking up XID's
When GlxGetXIDMap looks up an unknown XID, it will now look up a vendor based
on the screen number for the XID and the client that sent the current request.

In GlxGetXIDMap, if the XID is for a regular X window, then it won't be in the
(XID -> vendor) mapping, so we have to look up a vendor by screen number.

With this change, GlxGetXIDMap will use the (screen -> vendor) map for
whichever client sent the current request, instead of using the global
(screen -> vendor) map.

Since GlxGetXIDMap doesn't take a ClientPtr argument, GlxDispatchRequest will
store the client for the current request in a global variable. That way, the
ABI for GLXVND doesn't need to change.

v2: Fix an error check in GlxDispatchRequest.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2019-05-17 08:25:23 -07:00
Kyle Brenneman
37a36a6b5b GLX: Add a per-client vendor mapping.
Each client now has its own (screen, vendor) mapping.

Currently, it's just a copy of the global mapping, but later changes will allow
it to change.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2019-05-17 08:25:22 -07:00
Adam Jackson
2aec5c3c81 glx: Fix potential crashes in glXWait{GL,X}
glxc->drawPriv will be NULL if the context is direct, or if it is
current but without a bound drawable. Mesa's libGL won't normally emit
protocol for direct contexts for these calls, but a malign client could
still crash the server.
2019-05-14 12:43:31 -04:00
brian
a0f738a673 Fixed ioperm calls in hwEnableIO 2019-05-12 19:50:06 +00:00
Topi Miettinen
bb46e78540 os: add support for systemd notification
It can take some time for Xorg to start. If Xorg runs as a systemd
service and other services are based on it, they have no way to
determine when Xorg is really ready to accept requests. Let's use
sd_notify() provided by libsystemd to signal systemd for readiness.
If Xorg has not been started as a systemd service, this won't do
anything.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2019-05-07 09:01:47 +03:00
Adam Richter
9d25408a59 assert(a && b) --> assert(a); assert(b)
Separate each statement of the form "assert(a && b);" into "assert(a);"
and "assert(b);" for more precise diagnostics, except for this clever
use in drmmode_display.c where it was used to pass a hint to developers:

	assert(num_infos <= 32 && "update return type");
2019-05-02 15:02:36 -07:00
Jon Turney
dd1aebccf2 travis: Suppress uninteresting warnings on OSX
Suppress uninteresting warnings on OSX that we are drowning in, turned
on by default in meson.
2019-05-02 15:42:58 +00:00
Jon Turney
f0e22a76c9 travis: Add OSX meson build to matrix
Unfortunately, a 'brew update' is currently needed to get the meson >=
0.46.0 required by xserver.
2019-05-02 15:42:58 +00:00
Jon Turney
0bdfa5bc0a travis: Don't produce fat binaries on OSX
Trying to build fat binaries for multiple arches tickles a bug [1] in
the framework detector in meson 0.50.  Workaround this by not bothering
building for x86, which is probably no great loss :S

https://github.com/mesonbuild/meson/issues/5290
2019-05-02 15:42:58 +00:00
Jon Turney
655b1eb32e meson: Convert xquartz from autotools
Differences from autotools:

* Autotools defined NO_ALLOCA for OSX builds.  I don't think we need
this anymore as Xalloc.h is no longer used anywhere in the xserver.

* X11.bin is linked with -u,miDCInitialize, and then libserver_mi
provided to satisfy (just) that.  It's been that way since the commit
which added it.  We can't write the equivalent in meson due to linker
argument ordering issues, but do we really need to?

* An explicit -Dsecure-rpc=false is required for OSX, since in meson we
don't do the checks that XTRANS_SECURE_RPC_FLAGS did for the existence
of the specific RPC functions required.
2019-05-02 15:42:58 +00:00
Jon Turney
e5f4c7c80b xquartz: Fix a typo in man page substitution
The typo fixed in d69460159 was still present for this setting when
added in ac439842.

meson warns that there is no substitution with this name.
2019-05-02 15:42:58 +00:00
Jon Turney
ecf62b7ba6 meson: Build rootless extension 2019-05-02 15:42:58 +00:00
Jon Turney
b4ed20c4f1 Promote file containing date & time build was configured to top-level
Promote the generated file containing the date & time build was
configured to top-level.

Rename it from xf86Build.h to buildDateTIme.h.

Use it as well in XQuartz, stringize BUILD_DATE when needed.
2019-05-02 15:42:58 +00:00
Adam Richter
71cff63c06 hw/dmx/glxProxy/glxcmds.c CreateContext(): free glxc->real_ids and glxc in a couple of error branches, per complaints from cppcheck. 2019-05-01 15:22:15 -07:00
Adam Richter
b6eb8cf03f hw/xfree86/os-support/linux/lnx_agp.c xf86GetAGPInfo(): free(info) in an error path, caught by cppcheck. 2019-05-01 15:22:02 -07:00
Adam Richter
99904a3a7b hw/xwin/glx/indirect.c glxWinScreenProbe(): Add free(screen) that was missing from an error path. Caught by cppcheck. 2019-05-01 15:21:48 -07:00
Adam Jackson
007d812a83 glx: Fix GLX_CONTEXT_RELEASE_BEHAVIOR_ARB handling
None of this was getting compiled because we hadn't defined the macro
(and aren't getting them from <GL/glxext.h> because reasons). Fix that.

Fixes: xorg/xserver#684
2019-05-01 14:38:09 +00:00
Jon Turney
a2302de6fe hw/xwin: Remove mwextwm mode
This has always been described as 'experimental'

We don't think this has any users: This mode has been disabled in Cygwin
packages since March 2016. We've never provided the xwinwm WM for x86_64
Cygwin. No one has even asked where the option has gone.

This leaves XQuartz as the only user of the rootless extension.

Remove --enable-windowswm configure option
Remove multiwindowextwm stuff from Makefiles
Remove -mwextwm option
Remove -mwextwm from man-page and help
Un-ifdef XWIN_MULTIWINDOWEXTWM

v2:
Remove rootless include paths
Remove windowswmproto from meson.build
2019-05-01 14:06:15 +00:00
Jon Turney
504468d2cf meson: Don't use strndup() unless it's prototyped
A workaround for https://github.com/mesonbuild/meson/issues/3672

MinGW-w64 gcc has a built-in strndup, but it's not in the C library and
MinGW-w64 headers don't prototype it.

Don't try to use it, as that will cause an undefined reference if gcc
decides that an out-of-line call is appropriate.
2019-04-30 20:07:51 +00:00
Jon Turney
d3a528c91e Remove unneeded include of dix.h from strcasestr.c
In the meson build, functions to make up for the shortcomings of libc
are compiled into a separate library. We don't bother making the pixman
headers available (reasonably enough) to this compilation, but they are
required indirectly by dix.h.  Just remove this unneeded include.
2019-04-30 20:07:51 +00:00
Jon Turney
fd52110ec4 meson: Don't try to build tests on Windows
Most of these could be made to work, but would need to be ported off
using fork and poll...
2019-04-30 20:07:51 +00:00
Jon Turney
50b8670fdf meson: Require clock_gettime() as well for MONOTONIC_CLOCK
As configure.ac, require that clock_gettime() exists as well to use
MONOTONIC_CLOCK (MinGW provides the define, but not the function)
2019-04-30 20:07:51 +00:00
Jon Turney
92a52611f6 meson: Link with ws2_32 for socket functions on Windows 2019-04-30 20:07:51 +00:00
Jon Turney
d21224cd15 meson: Don't set UNIXCONN on Windows
As XTRANS_CONNECTION_FLAGS did, don't try to build unix socket support
on Windows.
2019-04-30 20:07:51 +00:00
Jon Turney
93a1cdcc78 meson: Fix hw/xwin for -Dglx=false
hw/xwin/meson.build:140:0: ERROR:  Unknown variable "xwin_windowsdri".
hw/xwin/meson.build:141:0: ERROR:  Unknown variable "xwin_glx".
2019-04-30 20:07:51 +00:00
Jon Turney
331850ce6f meson: Fix value of libglxvnd in -Dglx=false build
hw/vfb/meson.build:7:0: ERROR:  '' is not a target.
2019-04-30 20:07:51 +00:00
Jon Turney
c2feeca1b0 meson: Absence of dri.pc is an error if building with GLX
Currently, this can error if dri.pc isn't found, as we can't then get
the value of pkgconfig variable from it:

include/meson.build:199:10: ERROR:  'dri' is not a pkgconfig dependency

I think we need DRI_DRIVER_PATH (only) when building GLX, even if dri2/3
isn't enabled, so we know where to load swrast_dri.so from.

(For autotools, configure.ac directly calls `pkg-config
--variable=dridriverdir dri`, the backticks swallowing any error,
causing the value of this define to be empty if dri.pc isn't present)
2019-04-30 20:07:51 +00:00
Jon Turney
1f5742d271 meson: Fix building unit tests when protocol headers aren't in default include path 2019-04-29 11:49:46 +00:00
Jon Turney
f013979507 xquartz: Add stub ddxInputThread()
Omitted from 4ad21c32
2019-04-28 22:38:51 +00:00
Fabrice Fontaine
836f93de99 hw/xwayland/Makefile.am: fix build without glx
Commit d8ec33fe05 added libglxvnd.la to
Xwayland_LDFLAGS but GLX can be disabled through --disable-glx.
In this case, build fails on:

make[3]: *** No rule to make target '../../glx/libglxvnd.la', needed by 'Xwayland'.  Stop.
make[3]: *** Waiting for unfinished jobs....

Fixes:
 - http://autobuild.buildroot.org/results/397f8098c57fc6c88aa12dc8d35ebb1b933d52ef

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-04-23 22:17:41 +00:00
Diego Viola
0854732d55 ephyr: fix typo: rquires -> requires
Signed-off-by: Diego Viola <diego.viola@gmail.com>
2019-04-19 22:13:46 -03:00
Jon Turney
9c7ebf259f appveyor: Use ccache
Reduces i686 cygwin no-change build time from ~7 minutes to ~2.5 minutes
2019-04-18 13:58:11 +01:00
Jon Turney
16d8513759 appveyor: Drop cleaning of packaged libtool .la files
Not needed as meson doesn't use libtool.  I think they've all been
rebuilt now, in any case...
2019-04-18 13:27:50 +01:00
Jon Turney
f3e6002d79 appveyor: Drop trying to preserve build artefacts
We stopped staging them in 1519475a, so this did nothing.
2019-04-18 13:04:22 +01:00
Jon Turney
883530835d appveyor: Drop installing unnecessary packages
Drop installing packages which were used by the autotools build (or
maybe even monolithic build!) but are no longer required by the meson
build

Also, alphabetically sort within tools, protocol headers, devel
libraries, miscellaneous groups to match [1]

[1] https://x.cygwin.com/docs/cg/prog-build-prerequisites.html

Also, update to require xkbcomp-devel, split from xkbcomp
2019-04-18 12:24:36 +01:00
Jon Turney
6370cf026a appveyor: Reformat an absurdly long line in .appveyor.yml
Using YAML line-folding doesn't seem possible, as setup doesn't tolerate
spaces between package names, so instead drop some unneeded double quotes,
double quote the whole thing and escape newlines
2019-04-18 12:22:29 +01:00
Alex Goins
7f962c70b6 xsync: Add resource inside of SyncCreate, export SyncCreate
As shown by DRI3 adding the SyncCreateFenceFromFD() function, extensions may
want to create a fence, then initialize it in their own way. This currently
can't be done without adding a function directly to Xext/sync.c due to the fact
that the RTFence resource type is private and there is no external interface to
add to it.

To facilitate other X extensions creating fences and initializing them, this
change exports SyncCreate() and adds the resource directly within it. Callers no
longer need to call AddResource() after SyncCreate(), they only need to
initialize the SyncObject.

To prevent FreeFence() and FreeCounter() from segfaulting if the call to
AddResource() fails before the sync object is initialized, this adds a new
'initialized' parameter to SyncObject that, when FALSE, causes FreeFence() and
FreeCounter() to skip de-initialization and simply free the object.
Initialization after adding the resource shouldn't otherwise be a problem due to
the single-threaded nature of X.

Signed-off-by: Alex Goins <agoins@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2019-04-17 14:01:17 -07:00
Eric Anholt
8702c938b3 glamor: Introduce a central place for our pixmap format/type handling.
We had various helper functions trying to come up with the
internalformat/format/type/render formats for pixmaps, and it's much
nicer to just detect what those should be once at startup.  This gives
us a chance to do the right thing for GLES.

It also, notably, fixes our format/type for depth 15 and 16 setup for
desktop GL, so that we actually allocate 16bpp (GL_RGB/565) on most
drivers instead of 32bpp (GL_RGB/UBYTE).

GLES still has regressions over desktop (2 regressions in llvmpipe
XTS, many in rendercheck), but I think this is a good baseline.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-04-17 19:34:48 +00:00
Eric Anholt
c94da112a7 glamor: Plumb the pixmap through fbo creation instead of a "format"
For GLES, we're going to need a lot more logic for picking the
iformat/format/type of texture setup, so we'll want the pixmap's depth
and is_cbcr flag.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-04-17 19:34:48 +00:00
Eric Anholt
34485be256 glamor: Stop trying to store the pixmap's "format" in glamor_pixmap_fbo.
"format" is a bit of a confused term (internalformat vs GL format),
and all we really needed was "is this GL_RED?"

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-04-17 19:34:48 +00:00
Eric Anholt
1b2e224d7d glamor: Switch the gl_flavor to a boolean is_gles.
There are only 2 flavors we are distinguishing -- GL versions are
handled separately.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-04-17 19:34:48 +00:00
Jon Turney
2764128e9f Fix missing prototype warning for xf86_find_platform_device_by_devnum()
../hw/kdrive/src/kdrive.c:999:1: warning: no previous prototype for ‘xf86_find_platform_device_by_devnum’ [-Wmissing-prototypes]

Place the same guards around this stub as are around including the
hotplug.h header which declares the prototype.
2019-04-17 13:57:38 +01:00
Jon Turney
ba59427aba Fix maybe-uninitialized warning in xf86NewInputDevice()
If SYSTEMD_LOGIND is not defined, systemd_logind_take_fd is defined as a
macro evaluating to -1 by systemd-logind.h, leaving paused
uninitialized.

../hw/xfree86/common/xf86Xinput.c: In function ‘xf86NewInputDevice’:
../hw/xfree86/common/xf86Xinput.c:919:16: warning: ‘paused’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../hw/xfree86/common/xf86Xinput.c:877:10: note: ‘paused’ was declared here
2019-04-17 13:57:38 +01:00