Commit Graph

16870 Commits

Author SHA1 Message Date
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
Michel Dänzer
2e256e8260 glamor: Allow HW acceleration for more RENDER formats
As long as the storage format is compatible.

v2:
* Remove explicit cases for formats handled by the default case.

Reviewed-by: Eric Anholt <eric@anholt.net>
2018-12-20 12:23:54 +01:00
Michel Dänzer
7e6faa5b3c glamor: Check that storage format is compatible with RENDER format
Fixes x2r10g10b10 related rendercheck failures.

Reviewed-by: Eric Anholt <eric@anholt.net>
2018-12-20 12:22:44 +01:00
Michel Dänzer
d12881ea1d Revert "ci: Work around broken python UTF8 handling in the CI docker image"
This reverts commit 899d260701.

No longer necessary with the previous changes.

Reviewed-by: Eric Anholt <eric@anholt.net>
2018-12-17 17:52:39 +01:00
Michel Dänzer
bc6998b728 gitlab-ci: Set LC_ALL=C.UTF-8
Although piglit could now handle non-ASCII characters in the
environment, meson was still failing without this (even though it's
using Python 3).

Reviewed-by: Eric Anholt <eric@anholt.net>
2018-12-17 17:52:39 +01:00
Michel Dänzer
4aaaf69229 test: Use .../piglit instead of .../piglit-*.py
The latter use Python 2 and break with any non-ASCII characters in the
environment, the former uses Python 3 and works fine in that case.

Reviewed-by: Eric Anholt <eric@anholt.net>
2018-12-17 17:52:39 +01:00
Michel Dänzer
f56d8e2282 gitlab-ci: Docker image can be generated as part of pipeline
This removes the dependency on an externally generated docker image, and
should make it easier to update the docker image or make other changes
related to it.

This is based on Debian testing, because I'm most familiar with Debian.
But it should be easy to base it on another distro.

v2:
* Use kaniko instead of docker-in-docker for image generation, so it can
  also work in unprivileged runners.
* Drop piglit.conf & tetexec.cfg overrides, just make sure the files in
  the image work.
2018-12-17 17:40:08 +01:00
Michel Dänzer
ed44f9cd6a Drop Travis Linux build in favour of GitLab CI
Fold build-travis-deps.sh into .gitlab-ci.yml.

Preparation for the next change, which would break the Travis Linux
build.

Reviewed-by: Eric Anholt <eric@anholt.net>
2018-12-17 15:40:52 +01:00
Jon Turney
0e541b1093 meson: Add misc unit tests
v2:
has_link_argument requires meson 0.46.0
2018-12-14 11:32:31 +00:00
Peter Hutterer
fde27b9b48 test: fix failing tests
Broken since 69d8ea4a49 because our fake screen
didn't have a root window and writing the XKB rules prop would happily
segfault. Fix this by setting up the required bits.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Michel Dänzer michel.daenzer@amd.com
2018-12-14 10:49:23 +10:00
Michel Daenzer
a7472da941 Make artifacts of piglit results if job fails
Can be useful for figuring out what caused the failure.
2018-12-12 18:41:54 +01:00
Michel Daenzer
c1bb392b1d travis: Use a single meson invocation
The prefix setting didn't take for some reason.
2018-12-12 12:55:57 +01:00
Olivier Fourdan
c731165402 dix: cache ResourceClientBits() value
The `LimitClient` is set once and for all at startup, whereas the
function `ResourceClientBits()` which returns the client field offset
within the XID based on the value of `LimitClient` can be called
repeatedly.

Small optimization, cache the result of `ilog2()`, that saves running
the same loop over and over each time `ResourceClientBits()` is called.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2018-12-11 18:41:33 +00:00
Ilia Mirkin
48b1af2718 modesetting: fix conn_id termination and potential overrun by 1 byte
Noticed when porting this logic to xf86-video-nouveau, and valgrind
complained about conditional jump based on uninitialized data.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2018-12-11 13:34:56 -05:00
Adam Jackson
899d260701 ci: Work around broken python UTF8 handling in the CI docker image
Gitlab very kindly exposes the details of the git commit message (among
much else) in the environment. Unfortunately, piglit tries to handle the
environment in non-UTF8-safe ways, which means if the top-of-tree commit
mentions non-ASCII characters (say, in the author's name) then all the
tests fail and so does the pipeline.

Fortunately none of those variables are things our piglit invocation
needs. Since I've failed to rebuild the docker image as yet, just clear
the likely variables from the environment before running piglit.

This-makes-me: ☹
2018-12-11 12:41:26 -05:00
Adam Jackson
82ed89c0f8 automake: Distribute meson's configure header templates
Fixes: xorg/xserver#17
2018-11-29 14:48:11 -05:00
Lionel Landwerlin
a425eee6dc present: fix compile warning with debug traces
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2018-11-29 16:54:45 +00:00
Lyude Paul
7a44e8d400 modesetting: Actually disable CRTCs in legacy mode
Believe it or not, somehow we've never done this in legacy mode! We
currently simply change the DPMS property on the CRTC's output's
respective DRM connector, but this means that we're just setting the
CRTC as inactive-not disabled. From the perspective of the kernel, this
means that any shared resources used by the CRTC are still in use.

This can cause problems for drivers that are not yet fully atomic,
despite using the atomic helpers internally. For instance: if CRTC-1 and
CRTC-2 are still enabled and use shared resources within the kernel (an
MST topology, for example), and then userspace tries to go enable CRTC-3
on the same topology this might suddenly fail if CRTC-3 needs the shared
resources CRTC-1 and CRTC-2 are using. While I don't know of any
situations in the mainline kernel that actually trigger this, future
plans for reworking the atomic check of MST drivers are absolutely
going to make this into a real issue (they already are in my WIP
branches for the kernel).

So: actually do the right thing here and disable CRTCs when they're not
going to be used anymore, even in legacy mode.

Signed-off-by: Lyude Paul <lyude@redhat.com>
2018-11-29 16:21:26 +00:00
Alan Coopersmith
17a22ad948 Update configure.ac bug URL for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-25 12:59:41 -08:00
Alan Coopersmith
5d097c2a20 Update README for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-25 20:55:11 +00:00
Michel Dänzer
e6cd1c9bde xwayland: Don't take buffer release queue into account for frame timer
The buffer release queue has two kinds of entries:

* Pending async flips.
* Completed flips waiting for their buffer to be released by the Wayland
  compositor.

xwl_present_timer_callback neither completes async flips nor releases
buffers, so the timer isn't needed for the buffer release queue.
2018-11-19 20:57:15 +00:00
Michel Dänzer
f541615342 xwayland: Don't need xwl_window anymore in xwl_present_queue_vblank
Fixes issue #12. Presumably the problem was that Present operations on
unmapped windows were executed immediately instead of only when reaching
the target MSC.
2018-11-19 20:57:15 +00:00
Michel Dänzer
8c9538573c xwayland: Add xwl_present_unrealize_window
When a window is unrealized, a pending frame callback may never be
called, which could result in repeatedly freezing until the frame timer
fires after a second.

Fixes these symptoms when switching from fullscreen to windowed mode in
sauerbraten.
2018-11-19 20:57:15 +00:00
Michel Dänzer
6b016d58d2 xwayland: Replace xwl_window::present_window with ::present_flipped
There's no need to keep track of the window which last performed a
Present flip. This fixes crashes due to the assertion in
xwl_present_flips_stop failing. Fixes issue #10.

The damage generated by a flip only needs to be ignored once, then
xwl_window::present_flipped can be cleared. This may fix freezing in
the (hypothetical) scenario where Present flips are performed on a
window, followed by other drawing requests using the window as the
destination, but nothing triggering xwl_present_flips_stop. The damage
from the latter drawing requests would continue being ignored.
2018-11-19 20:57:15 +00:00
Ray Strode
8738ce85df dix: ensure work queues are cleared on reset
If the server resets, most client workqueues are cleaned up as the
clients are killed.

The one exception is the server's client, which is exempt from
the killing spree.

If that client has a queued work procedure active, it won't get
cleared on reset.

This commit ensures it gets cleared too.
2018-11-19 19:37:10 +00:00
Samuel Thibault
364d649815 dix: do not send focus event when grab actually does not change
c67f2eac56 ("dix: always send focus event on grab change") made dix
always sent events when it's a NotifyGrab or NotifyUngrab, even if
from == to, because 'from' can just come from a previous XSetInputFocus
call.

However, when an application calls XGrabKeyboard several times on
the same window, we are now sending spurious FocusOut+FocusIn with
NotifyGrab, even if the grab does not actually change. This makes screen
readers for blind people spuriously emit activity events which disturb
screen reading workflow when e.g. switching between menus.

This commit avoids calling DoFocusEvents in that precise case, i.e. when
oldWin is a previous grab and the new grab is the same window.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-11-19 13:56:51 -05:00
Manoj Gupta
82f8cf8990 config/udev: Include header <sys/sysmacros.h> to use major/minor
glibc 2.25 has dropped sys/sysmacros.h from sys/types.h, so add
it explicitly in config/udev.c.

This is similar to the commit 84e3b96b53

Signed-off-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-11-14 10:26:48 -05:00
Michal Srb
fbdd4d679a dix/window: Use ConfigureWindow instead of MoveWindow
The screensaver can regularly move its window to random offsets. It should
use the ConfigureWindow function instead of calling the Screen's MoveWindow
directly. Some MoveWindow implementations, such as compMoveWindow, rely on
Screen's ConfigNotify being called first as it happens in ConfigureWindow.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-11-13 11:02:41 -05:00