Commit Graph

16897 Commits

Author SHA1 Message Date
Benjamin Tissoires
f706972309 CI: use wayland-ci-templates to manage the images
There shouldn't be a difference for users, but this way we do manage
all of our containers from freedesktop.org

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2019-03-27 17:06:53 +01:00
Michael Biebl
5a549c957a Revert "systemd-logind: Monitor systemd-logind going away"
systemd-logind since version 234 (released 2017-07-12) supports being
restarted without losing state [1]. From the systemd NEWS file [2]:

 * systemd-logind may now be restarted without losing state. It stores
   the file descriptors for devices it manages in the system manager
   using the FDSTORE= mechanism. Please note that further changes in
   other components may be required to make use of this (for example
   Xorg has code to listen for stops of systemd-logind and terminate
   itself when logind is stopped or restarted, in order to avoid using
   stale file descriptors for graphical devices, which is now
   counterproductive and must be reverted in order for restarts of
   systemd-logind to be safe. See
   https://cgit.freedesktop.org/xorg/xserver/commit/?id=dc48bd653c7e101.)

This reverts commit dc48bd653c.

Closes: #531

[1] https://github.com/systemd/systemd/pull/5600
[2] 9f09a95a7e
2019-03-21 00:09:22 +01:00
Jon Turney
f3567600cf meson: handle missing xkbcomp.pc better
Applying get_pkgconfig_variable() to a not-found dependency was always
documented as an error, but meson 0.49 now actually raises an error[1]:

  meson.build:110:4: ERROR:  'xkbcomp' is not a pkgconfig dependency

Check xkbcomp_dep is a suitable dependency type before applying
get_pkgconfig_variable() to it.

[1] but this is more by accident than design (see the discusssion at [2]
et seq.), so who knows where things will come to rest...

[2] https://github.com/mesonbuild/meson/pull/4444#issuecomment-442443301
2019-03-20 22:30:25 +00:00
Michel Dänzer
ef91da2757 present/scmd: Check that the flip and screen pixmap pitches match
If they don't, flipping will result in corrupted display.

Test case:

* Run Xorg at 1920x1080 with no window manager
* glxgears -geometry 2048x1080
2019-03-15 15:06:08 +00:00
Jon Turney
9114c4341c meson: Drop a meson version check
Drop some code conditional on meson version, which is not needed
since 7e046b94 bumped the minimum meson version
2019-03-14 21:23:23 +00:00
Jon Turney
c020769dbf
Add xf86OSInputThreadInit to stub os-support as well
stub os support also needs to provide xf86OSInputThreadInit, omitted in
ea1527a8
2019-03-13 16:07:36 +00:00
Michel Dänzer
2e18eec6f0 xwayland/present: Destroy sync_callback in xwl_present_cleanup
xwl_present_cleanup frees the struct xwl_present_window memory,
so if there's a pending callback, we have to destroy it to prevent
use-after-free in xwl_present_sync_callback.

Should fix issue #645.

Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2019-03-13 10:36:11 +01:00
Adam Jackson
f665a9c9e6 mi: Shortcut miDoCopy/miCopyArea based on clipList
This is maybe one more comparison, but it catches FullyObscured windows
slightly earlier, so it's kind of a wash. The important thing is this
allows for paintable but unmapped windows, which will have non-empty
clipList.
2019-03-11 17:02:28 +00:00
Adam Jackson
3904216b01 dix: Outdent Unmap{Window,Subwindows} a bit
No functional change, just folding some conditionals together.
2019-03-11 17:02:28 +00:00
Olivier Fourdan
74479a99ec glamor: pixmap FBO may not be allocated
If `_glamor_create_tex()` fails to allocate the FBO because of
GL_OUT_OF_MEMORY error, the `pixmap_priv->fbo` is NULL.

However, `glamor_get_pixmap_texture()` doesn't actually check whether
the `pixmap_priv->fbo` is NULL and will segfault with a NULL pointer
dereference trying to access the `pixmap_priv->fbo->tex`.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/647
2019-03-11 16:18:26 +00:00
Paul Kocialkowski
8c4e8d9eff glamor: Fallback to system memory for RW PBO buffer allocation
We currently support two modes of operation for RW PBO buffers: one
that allocates a pack buffer with GL memory and one that uses system
memory when the former is not supported.

Since allocation with system memory is less likely to fail, add a
fallback to system memory when GL memory failed instead of bailing
out.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2019-03-08 14:29:40 +01:00
Paul Kocialkowski
de6b3fac1f glamor: Propagate glamor_prepare_access failures in copy helpers
glamor_prepare_access can fail for a few reasons, especially when
failing to allocate a PBO buffer. Take this in account and bail in
the copy helpers that call the helper when a failure happens.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2019-03-08 14:29:40 +01:00
Paul Kocialkowski
bc2e12239f glamor: Error out on out-of-memory when allocating PBO for FBO access
Packed buffer allocation (which happens at glBufferData time with the
buffer bound) can fail when there is no GL memory left.

Pick up the error when it happens, print a proper error message, do
some cleanup and bail.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2019-03-08 14:29:40 +01:00
Paul Kocialkowski
c98c7709c6 glamor: Propagate FBO allocation failure for picture to texture upload
When uploading a picture to a texture, glamor_upload_picture_to_texture
calls glamor_pixmap_ensure_fbo to ensure that there is backing FBO.
The FBO will be allocated if the picture's drawable pixmap does not have
one already, which can fail when there is no GL memory left.

glamor_upload_picture_to_texture checks that the call succeeded and will
enter the failure path if it did not. However, unlike many other
functions in glamor, this one has ret set to TRUE initially, so it needs
to be set to FALSE when a failure happens.

Otherwise, the error is not propagated and the failure path return TRUE.
This leads to a fault when trying to access the FBO pointer later on.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2019-03-08 14:29:40 +01:00
Andy Ritger
e51ebc18a7 xfree86/modes: Add "NoOutputInitialSize" option
Normally, the X server infers the initial screen size based on any
connected outputs.  However, if no outputs are connected, the X server
picks a default screen size of 1024 x 768.  This option overrides the
default screen size to use when no outputs are connected.  In contrast
to the "Virtual" Display SubSection entry, which applies unconditionally,
"NoOutputInitialSize" is only used if no outputs are detected when the
X server starts.

Parse this option in the new exported helper function
xf86AssignNoOutputInitialSize(), so that other XFree86 loadable drivers
can use it, even if they don't use xf86InitialConfiguration().

Signed-off-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2019-03-06 11:33:29 -05:00
Adam Jackson
7e046b9467 meson: Bump required meson version to 0.46
We were being naughty:

WARNING: Project specifies a minimum meson_version '>= 0.42.0' but uses features which were added in newer versions:
 * 0.46.0: {'compiler.has_multi_link_argument', 'compiler.has_link_argument'}
2019-03-05 11:34:21 -05:00
Michel Dänzer
0ec9a13c2a Revert "gitlab-ci: Only run docker-image stage if relevant source files change"
This reverts commit 8694395fcf.

Some scenarios have come to light where this failed to ensure the docker
image exists:

* If the master branch of a forked repository is used for an MR which
  doesn't modify .gitlab-ci.yml, the docker-image job may not run.
* If the docker-image job of the first pipeline in a forked repository
  is cancelled or fails for any reason, and .gitlab-ci.yml isn't
  modified for the next pipeline run.
2019-02-27 15:59:01 +00:00
Alan Coopersmith
12769c516d os-support/solaris: Set IOPL for input thread too
Since the Solaris kernel tracks IOPL per thread, and doesn't inherit
raised IOPL levels when creating a new thread, we need to turn it on
in the input thread for input drivers like vmmouse that need register
access to work correctly.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-02-25 15:48:03 +00:00
Alan Coopersmith
ea1527a8a6 Add xf86OSInputThreadInit call from common layer into os-support layer
Allows os backends to run additional code as necessary to set up the
input thread.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-02-25 15:48:03 +00:00
Alan Coopersmith
4ad21c3247 Add ddxInputThread call from os layer into ddx layer
Allows ddx's to run additional code as necessary to set up the
input thread.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-02-25 15:48:03 +00:00
Alan Coopersmith
7533fa9bd5 os-support/solaris: Drop ExtendedEnabled global variable
Keeping track of kernel state in user space doesn't buy us anything,
and introduces bugs, as we were keeping global state but the Solaris
kernel tracks IOPL per thread.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-02-25 15:48:03 +00:00
Michel Dänzer
432fad04e7 gitlab-ci: Run make distcheck in autotools build & test job
We don't set the PIGLIT_DIR and XTS_DIR environment variables for make
distcheck for now, otherwise it complains about files left behind by
piglit.
2019-02-22 10:22:49 +01:00
Michel Dänzer
f9bbc9d5ea glx,xquartz: Fix make distcheck
Guard BUILT_SOURCES and CLEANFILES by XWIN_GLX_WINDOWS/XQUARTZ.
2019-02-22 10:21:27 +01:00
Michel Dänzer
2f12c80175 gitlab-ci: Add autotools build & test job 2019-02-20 11:06:18 +01:00
Michel Dänzer
b577df7745 gitlab-ci: Use ccache
Meson picks it up automatically.

Based on:

* https://gitlab.freedesktop.org/mesa/mesa/merge_requests/240
* https://gould.cx/ted/blog/2017/06/10/ccache-for-Gitlab-CI/
* https://stackoverflow.com/questions/53659419/ccache-no-hits-in-gitlab-ci

v2 based on the corresponding Mesa change:
* Quote CCACHE_(BASE)DIR environment variables.
* Clear ccache stats in before_script.
* Move cache stanza to the build-and-test job, the cache isn't used in
  the docker-image job.

Reviewed-by: Adam Jackson <ajax@redhat.com> # v1
2019-02-20 11:02:21 +01:00
Michel Dänzer
537f06e21e gitlab-ci: Add ccache to docker image, and leave in autotools
We're going to make use of these in build & test jobs.
2019-02-19 18:16:16 +01:00
Alexander Volkov
f6753c117e shm: Use memfd_create when possible
It doesn't require shared memory dir and thus allows
to avoid cases when this dir is detected incorrectly,
as in https://bugreports.qt.io/browse/QTBUG-71440

Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
2019-02-14 12:53:06 +03:00
Peter Hutterer
678d64aa2e Xi: lock the input thread for any pointer barrier list manipulation
The input thread checks the barriers for pointer positioning, swapping the
list out from underneath is considered impolite.

Reported-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2019-02-14 09:10:58 +10:00
Michel Dänzer
fede384962 gitlab-ci: Don't rely on $CI_PROJECT_NAME
The name of a forked repository can be changed later, in which case this
would fail to refer to the main repository.

Pointed out by Eric Engestrom in
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/224 .
2019-02-13 11:30:17 +01:00
Michel Dänzer
8694395fcf gitlab-ci: Only run docker-image stage if relevant source files change
Otherwise there's normally no need to run it. It will also run when a
new branch is created, which ensures that the docker image always exists
(e.g. in a newly forked repository).

Inspired by https://gitlab.freedesktop.org/mesa/mesa/merge_requests/143
2019-02-13 11:26:25 +01:00
Adam Jackson
8f8d358bad ramdac: Remove core ramdac code
Now that there are no ramdac drivers this can go.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2019-01-30 21:08:48 +00:00
Adam Jackson
f0385fb420 ramdac: Remove ramdac drivers
External RAMDACs are a very 1996 kind of thing, this code really doesn't
belong in the server.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2019-01-30 21:08:48 +00:00
Peter Harris
937a5b78a2 os: Fix GetTimeInMicros resolution
GetTimeInMillis is called first, which sets clockid to
CLOCK_MONOTONIC_COARSE, which is typically much lower resolution than
the callers of GetTimeInMicros want.

Prior to a779fda224, GetTimeInMillis and
GetTimeInMicros did not share a clockid.

Restore the clockid split to fix the granularity of GetTimeInMicros.

Signed-off-by: Peter Harris <pharris@opentext.com>
2019-01-30 14:56:46 -05:00
Michel Dänzer
a093a88531 present/wnmd: Allow flipping if the window pixmap matches the toplevel's
Instead of testing window->redirectDraw.

With Xwayland, the toplevel window is always redirected, so this would
unnecessarily preclude flipping there in some cases, e.g. with wlroots
based Wayland compositors or with fullscreen X11 windows in weston.

Fixes issue #631.
2019-01-30 19:13:54 +00:00
Adam Jackson
ff56048855 dri2: Stop pretending VGA arbitration matters
The VGA arbiter controls the PCI bus' routing of legacy VGA resources,
specifically the video memory aperture at 0xa0000-0xb0000 (640k should
be etc.) and a handful of I/O ports. Since 128k is far too small for a
real framebuffer these days, every driver instead maps a linear version
of VRAM through the PCI BAR. And no DRI2 drivers ever need I/O port
access, because all operations they might be used for (legacy VGA CRTC
setup, mostly) happen on the kernel side.

In other words, this just works, and we can stop breaking it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2019-01-30 14:08:41 -05:00
A. Wilcox
d3a26bbf61
DRI2: Add another Coffeelake PCI ID
A user of Adélie Linux reported that modesetting wasn't working properly on
their Intel i7-9700K-integrated UHD 630 GPU.  Xorg.0.log showed:

[   131.902] (EE) modeset(0): [DRI2] No driver mapping found for PCI device 0x8086 / 0x3e98
[   131.902] (EE) modeset(0): Failed to initialize the DRI2 extension.

Indeed, that PCI ID is missing from i965_pci_ids.  Adding it fixed the issue
and allowed the system to work with i965_dri under modesetting.
2019-01-26 15:37:56 -06:00
Adam Jackson
709c656297 vnd: Fix a silly memory leak
'disp' was already allocated by LookupVendorPrivDispatch above,
clobbering it will do no good.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2019-01-16 15:18:02 -05:00
Adam Jackson
bf991a5f98 mi: When {en,dis}abling extensions, match names case-insensitively
Both because extension names are inconsistently capitalized on the wire,
and because the table we're walking spells it COMPOSITE not Composite.
The latter is certainly also a bug, but there's no reason for us to be
that strict.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2019-01-16 20:11:24 +00:00
Adam Jackson
086c2e3de5 dri3: Fix XACE access mode for open and get_supported_modifiers
Neither opening a screen nor querying its modifiers confers the right to
attach the buffer for any particular pixmap. GetAttr seems more correct.

Fixes: xorg/xserver#550
2019-01-16 20:05:43 +00:00
Adam Jackson
6c1d720047 agp: Make the legacy AGP interface optional
The only thing using this anymore is the i810 driver, so this can safely
be disabled on non-i686 builds.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2019-01-16 19:50:15 +00:00
Adam Jackson
1e3f9ea14c randr: Remove funky indirection around the xf86 screen private key
All of the null checks here are redundant, you can't get to those paths
unless RANDR's already been initialized. Delete them, and remove the
pointer too.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2019-01-11 18:14:34 +00:00
Michel Dänzer
30044b2253 xfree86/modes: Don't clobber gamma LUT of compatibility output's CRTC
If the driver calls xf86HandleColormaps, CMapChangeGamma updates the HW
gamma LUT of all CRTCs via xf86RandR12LoadPalette. However,
xf86RandR12ChangeGamma was then clobbering the gamma LUT of the RandR
1.2 compatibility output's CRTC with the gamma curves computed from the
screen's global gamma values.

Fix this by bailing if xf86RandR12LoadPalette is installed.

Fixes: 02ff0a5d7e "xf86RandR12: Fix XF86VidModeSetGamma triggering a
                     BadImplementation error"
2019-01-11 16:25:42 +00:00
Rohan Garg
cc05c01925 glamor/glamor_egl.c: EGL_NATIVE_PIXMAP_KHR do not require contexts
From https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_image_pixmap.txt

 * If <target> is EGL_NATIVE_PIXMAP_KHR, and <ctx> is not EGL_NO_CONTEXT,
   the error EGL_BAD_PARAMETER is generated.

Fixes: a5321ea4 ("Allow to create textured pixmaps from gbm_bo without using gem names")
2019-01-10 21:35:19 +00:00
Rohan Garg
88dd4cea51 glamor/egl: Drop a implicit depends on EGL_KHR_no_config_context
Not all platforms provide EGL_KHR_no_config_context, this ensures
that eglCreateContext works on such platforms by querying for
a config.
2019-01-10 21:35:19 +00:00
Maya Rashish
e3fb178617 xfree86: Try nouveau on NetBSD as well. 2019-01-10 21:24:49 +00:00
Maya Rashish
bf2a7bb4ff Fix typo in error message 2019-01-10 18:40:20 +02:00
Olivier Fourdan
e8295c5020 xwayland: handle case without any crtc
Xwayland creates and destroys the CRTC along with the Wayland outputs,
so there is possibly a case where the number of CRTC drops to 0.

However, `xwl_present_get_crtc()` always return `crtcs[0]` which is
invalid when `numCrtcs` is 0.

That leads to crash if a client queries the Present capabilities when
there is no CRTC, the backtrace looks like:

  #0  raise() from libc.so
  #1  abort() from libc.so
  #2  OsAbort() at utils.c:1350
  #3  AbortServer() at log.c:879
  #4  FatalError() at log.c:1017
  #5  OsSigHandler() at osinit.c:156
  #6  OsSigHandler() at osinit.c:110
  #7  <signal handler called>
  #8  main_arena() from libc.so
  #9  proc_present_query_capabilities() at present_request.c:236
  #10 Dispatch() at dispatch.c:478
  #11 dix_main() at main.c:276

To avoid returning an invalid pointer (`crtcs[0]`) in that case, simply
check for `numCrtcs` being 0 and return `NULL` in that case.

Thanks to Michel Dänzer <michel.daenzer@amd.com> for pointing this as a
possible cause of the crash.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Bugzilla: https://bugzilla.redhat.com/1609181
2019-01-09 14:08:04 +01:00
Roman Gilg
bf5613f888 xwayland: Fix wm_fd readin with no listen_fds
Since 08843efc KWin was not able to start a Wayland session. Independently
of listen_fd_count add_client_fd must be called. Same holds for the
wm_selection_callback. Therefore just remove the condition.

Bugzilla: https://bugs.freedesktop.org/109220

Signed-off-by: Roman Gilg <subdiff@gmail.com>
2019-01-07 16:14:03 +01:00
Alan Coopersmith
7fb6338c68 os: Report errors opening authorization file (#469)
Fixes: xorg/xserver#469

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-01-01 16:50:24 -08:00
Michel Dänzer
a3d01ee9d0 glamor: Remove unused format_for_pixmap helper
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-12-21 09:47:45 +01:00