-
34553f50
by Ray Strode
at 2019-03-21T14:29:04Z
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.
(cherry picked from commit 8738ce85df535bdfdfecfce1c0d64e209cc6e508)
Fixes: xorg/xserver#670
-
8e2f5410
by Michel Dänzer
at 2019-03-25T11:45:52Z
Revert "gitlab-ci: Only run docker-image stage if relevant source files change"
This reverts commit 8694395fcfd407190db74f31064960e484747377.
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.
(Cherry picked from commit 0ec9a13c2a207e98e2dd6b352552c0e069af0727)
-
57815633
by Michel Dänzer
at 2019-03-25T11:45:52Z
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>
(Cherry picked from commit 2e18eec6f03cc4d9d5bf62853c65d341b363f4b3)
-
87491ced
by Michel Dänzer
at 2019-03-25T11:45:52Z
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
(Cherry picked from commit ef91da2757050652c724f6e674e8b1acf5d0cb31)
-
bb74db6b
by Olivier Fourdan
at 2019-04-05T10:33:28Z
xwayland: search for a render node to use
wl_drm's protocol "device" event provides the path to the DRM device,
which may not be a render node, thus causing Xwayland to fall back to
DRM authentication which may fail if the user has switched to another
VT while Xwayland is starting.
Search for a render node corresponding to the given DRM device and try
to use it instead, as render nodes do not need DRM authentication and
Xwayland can make use of them if it can find one.
Closes: https://bugs.freedesktop.org/108038
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
(Cherry picked from commit 361894497c6802b62c2da4a3dc7e98939fb24404)
-
d0c7483b
by Peter Hutterer
at 2019-04-05T10:39:00Z
xwayland: fix a realloc OOM error case
Found by coverity
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(Cherry picked from commit 7c25439f0db4c20a4eab4ed44262eb396305f58a)
-
5bc29a67
by Olivier Fourdan
at 2019-05-20T10:11:11Z
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
(Cherry picked from commit 74479a99ecf18fdfdafd033b5efd8d785dd12c28)
-
24086852
by Peter Hutterer
at 2019-05-28T18:21:57Z
dix: leave last.valuators alone on slave switch
Terms:
dev->last.valuator[] is the last value given to us by the driver
dev->valuator.axisVal[] is the last value sent to the client
dev->last.scroll[] is the abs value of the scroll axis as given by the driver,
used for button emulation calculation (and the remainder)
This function updates the device's last.valuator state based on the current
master axis state. This way, relative motion continues fluidly when switching
between devices. Before mouse 2 comes into effect, it's valuator state is
updated to wherever the pointer currently is so the relative event applies on
top of that.
This can only work for x/y axes, all other axes aren't guaranteed to have the
same meaning and/or may not be present:
- xtest device: no valuator 2
- mouse: valuator 2 is horizontal scroll axis
- tablet: valuator 2 is pressure
Scaling the current value from the pressure range into the range for
horizontal scrolling makes no sense. And it causes scroll jumps:
- scroll down, last.valuator == axisVal == 20
- xdotool click 1, the XTest device doesn't have that valuator
- scroll up
- updateSlaveDeviceCoords reset last.valuator to 0 (axisVal == 20)
- DeviceClassesChangedEvent includes value 20 for the axis
- event is processed, last.value changes from 0 to -1
- axisVal is updated to -1, causing a jump of -21
The same applies when we switch from tablet to mouse wheel if the pressure
value is 0 on proximity out (basically guaranteed). So let's drop this code
altogether and only leave the scaling for the relative x/y motion.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit d7b1753d446ecde3ff58e3de39a634c3137473c8)
-
fbbdd561
by Adam Jackson
at 2019-05-30T18:07:06Z
xserver 1.20.5
Signed-off-by: Adam Jackson <ajax@redhat.com>
-
6711b5c6
by Olivier Fourdan
at 2019-06-05T13:12:31Z
xwayland: Avoid a crash on pointer enter with a grab
On pointer enter notification, Xwayland checks for an existing pointer
warp with a `NULL` sprite.
In turn, `xwl_pointer_warp_emulator_maybe_lock()` checks for an existing
grab and the destination window using `XYToWindow()` which does not
check for the actual sprite not being `NULL`.
So, in some cases, when the pointer enters the surface and there is an
existing X11 grab which is not an ownerEvents grab, Xwayland would crash
trying to dereference the `NULL` sprite pointer:
#0 __GI_raise ()
#1 __GI_abort () at abort.c:79
#2 OsAbort () at utils.c:1351
#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 XYToWindow (pSprite=0x0, x=0, y=0) at events.c:2880
#9 xwl_pointer_warp_emulator_maybe_lock () at xwayland-input.c:2673
#10 pointer_handle_enter () at xwayland-input.c:434
Avoid the crash by simply checking for the sprite being not `NULL` in
`xwl_pointer_warp_emulator_maybe_lock()`
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Bugzilla: https://bugzilla.redhat.com/1708119
(cherry picked from commit 0a07446318f248b65fcbc8ab8a73ead51153f09e)
-
34ad57e5
by Olivier Fourdan
at 2019-06-05T13:12:31Z
xwayland: Check status in GBM pixmap creation
The current code in `xwl_glamor_gbm_create_pixmap_for_bo()` may fail in
several cases that are not checked for:
- `eglCreateImageKHR()` may have failed to create the image,
- `glEGLImageTargetTexture2DOES()` may fail and set an error,
- `glamor_set_pixmap_texture()` may fail for very large pixmaps
because the corresponding FBO could not be created.
Trying to upload content to a pixmap with no texture will crash Mesa,
glamor and Xwayland, e.g.:
XXX fail to create fbo.
(EE)
(EE) Backtrace:
(EE) 0: Xwayland (OsSigHandler+0x29)
(EE) 1: libpthread.so.0 (funlockfile+0x50)
(EE) 2: libc.so.6 (__memmove_avx_unaligned_erms+0x215)
(EE) 3: dri/i965_dri.so (_mesa_format_convert+0xab3)
(EE) 4: dri/i965_dri.so (_mesa_texstore+0x205)
(EE) 5: dri/i965_dri.so (store_texsubimage+0x28c)
(EE) 6: dri/i965_dri.so (intel_upload_tex+0x13b)
(EE) 7: dri/i965_dri.so (texture_sub_image+0x134)
(EE) 8: dri/i965_dri.so (texsubimage_err+0x150)
(EE) 9: dri/i965_dri.so (_mesa_TexSubImage2D+0x48)
(EE) 10: Xwayland (glamor_upload_boxes+0x246)
(EE) 11: Xwayland (glamor_copy+0x4d1)
(EE) 12: Xwayland (miCopyRegion+0x96)
(EE) 13: Xwayland (miDoCopy+0x43c)
(EE) 14: Xwayland (glamor_copy_area+0x24)
(EE) 15: Xwayland (damageCopyArea+0xba)
(EE) 16: Xwayland (compCopyWindow+0x31c)
(EE) 17: Xwayland (damageCopyWindow+0xd3)
(EE) 18: Xwayland (miResizeWindow+0x7b7)
(EE) 19: Xwayland (compResizeWindow+0x3a)
(EE) 20: Xwayland (ConfigureWindow+0xa96)
(EE) 21: Xwayland (ProcConfigureWindow+0x7d)
(EE) 22: Xwayland (Dispatch+0x320)
(EE) 23: Xwayland (dix_main+0x366)
(EE) 24: libc.so.6 (__libc_start_main+0xf3)
(EE) 25: Xwayland (_start+0x2e)
(EE)
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE)
Check for the possible cases of failure above and fallback to the
regular glamor pixmap creation when an error is detected.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/661
(cherry picked from commit fc6380a11be4c6202ed72f241dd9ee8c7c24671d)
-
6e199e46
by Olivier Fourdan
at 2019-06-05T13:12:31Z
glamor: Make pixmap exportable from `gbm_bo_from_pixmap()`
If a pixmap is not exportable, `glamor_gbm_bo_from_pixmap()` would fail
and the modesettings driver would consequently fail to do its page flip,
which both prevents Present from working and also fill up the logs with
error messages such as:
(EE) modeset(0): Failed to get GBM bo for flip to new front.
(EE) modeset(0): present flip failed
Refactor the code so that `glamor_gbm_bo_from_pixmap()` takes care of
making the pixmap exportable.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Yuxuan Shui yshui@hadean.com
See-also: https://gitlab.freedesktop.org/xorg/xserver/merge_requests/131
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/68
Fixes: 86b2d8740a "glamor: Reallocate pixmap storage without modifiers
if necessary"
(cherry picked from commit 26fe29f4fa53cbb7d51892e2cf397c084093812f)
-
c86222d4
by Carlos Garnacho
at 2019-06-06T09:48:13Z
xwayland: Reset scheduled frames after hiding tablet cursor
Hiding the tablet tool cursor results in it being hidden forever after.
This is due to the stale frame callback that will neither be disposed
or replaced. This can be reproduced in krita (X11) as the pointer
cursor is hidden while over the canvas.
Clearing the frame callback ensures the correct behavior in future
xwl_tablet_tool_set_cursor() calls (i.e. a new cursor surface being
displayed, and a new frame callback created), and is 1:1
with xwl_seat_set_cursor() for pointers.
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
(cherry picked from commit dea4a74621294391ce5901bb3339e1b8e7151efc)
-
26b6ba53
by Michel Dänzer
at 2019-07-10T15:04:11Z
Revert "present/scmd: Check that the flip and screen pixmap pitches match"
This reverts commit ef91da2757050652c724f6e674e8b1acf5d0cb31.
I thought this couldn't work under any circumstances, but I was wrong,
and drivers are already checking for cases that really cannot work.
Fixes issue #839.
(cherry picked from commit 2f0dd1816d556eef8c4b691330d39f13e1ed93f0)
-
98e3db2a
by Marco Trevisan (Treviño)
at 2019-07-26T19:44:03Z
Xi: Use current device active grab to deliver touch events if any
When Retrieving touch delivery data we need to check if we have an active
grab on such device, and in that case use it to delivery events.
If we don't do this, when rejecting the touch events in DeactivatePointerGrab,
we will end-up in creating an implicit grab that will change the device
deviceGrab's state, causing a recursion during TouchEndTouch.
Fixes #7
https://bugs.freedesktop.org/show_bug.cgi?id=96536
(cherry picked from commit 35e5a76cc1d02801fadd49d12e60664b02e4bebc)
-
1804e732
by Matt Roper
at 2019-07-26T19:44:03Z
dri2: Sync i965_pci_ids.h from mesa
Copied from Mesa with no modifications.
This update brings in a significant number of new platform ID's.
Syncs with mesa up to commit e334a595e ("intel/icl: Add new ICL
PCI-IDs").
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit a8d9ebeb43583e8d8ef182ac15adbdce256d4867)
-
44c693f4
by Olivier Fourdan
at 2019-07-26T19:44:03Z
xwayland: Update screen pixmap on output resize
Running Xwayland non-rootless and resizing the output would lead to a
crash while trying to update the larger areas of the root window.
Make sure we resize the backing pixmap according to the new output size
to avoid the crash.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/834
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit ce9455b5ee389b100a9b7da76b79690d97211b7a)
-
df7ee10d
by Adam Jackson
at 2019-07-26T19:44:03Z
xwayland: Expand the RANDR screen size limits
There's not really a good way to query this from the wayland server, so
just set the maximum to the X11 protocol limits. While we're at it,
lower the minimum screen size to something implausibly small too, just
in case.
Fixes: xorg/xserver#850
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit d0850241c6218f61127c45c2f95d6e791c3fea44)
-
dfd51be3
by Olivier Fourdan
at 2019-07-26T19:44:03Z
xwayland: Do not free a NULL GBM bo
Both `gbm_bo_create()` and `gbm_bo_create_with_modifiers()` can fail and
return `NULL`.
If that occurs, `xwl_glamor_gbm_create_pixmap()` will not create a
pixmap for the (NULL) GBM bo, but would still try to free the bo which
leads to a crash in mesa:
[...]
#7 <signal handler called>
#8 in gbm_bo_destroy (bo=0x0) at ../src/gbm/main/gbm.c:439
#9 in xwl_glamor_gbm_create_pixmap () at xwayland-glamor-gbm.c:245
#10 in ProcCreatePixmap () at dispatch.c:1440
#11 in Dispatch () at dispatch.c:478
#12 in dix_main () at main.c:276
To avoid the crash, only free the GBM bo if not `NULL`.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Bugzilla: https://bugzilla.redhat.com/1729925
(cherry picked from commit d9ec525059dbe96fc893c73c0362be2a6dd73e85)
-
82f01ad7
by Alex Goins
at 2019-08-13T21:53:55Z
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>
(cherry picked from commit 7f962c70b6d9c346477f23f6c15211e749110078)
-
1fdb7cbc
by Kyle Brenneman
at 2019-08-13T21:53:55Z
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>
(cherry picked from commit 37a36a6b5b887d5c5a17a6931ceba8ad5d1bb6d5)
-
abeae4a6
by Kyle Brenneman
at 2019-08-13T21:53:55Z
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>
(cherry picked from commit 8b67ec7cc6fda243480a5a8ca118b66242f3eb2c)
-
d3034ef2
by Kyle Brenneman
at 2019-08-13T21:53:55Z
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>
(cherry picked from commit 56c0a71fdd94a008e5d746261f70a713c4767f93)
-
39b3005c
by Aaron Plattner
at 2019-08-13T21:53:55Z
GLX: Set GlxServerExports::{major,minor}Version
Commit 56c0a71fdd94a008e5d746261f70a713c4767f93 incremented the
GLXSERVER_VENDOR_ABI_MINOR_VERSION define, but this define was not actually
being used to set glxServer.minorVersion.
Update the initializer for glxServer to use the correct version numbers.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
(cherry picked from commit b4231d69028adc8123801a7552b40a15ea928d1b)
-
8449c862
by Adam Jackson
at 2019-08-21T18:50:13Z
miext/sync: Fix needless ABI change
The initialized field was added in:
commit 82f01ad7869e3f2be51e41a8246dab5982bbc36a
Author: Alex Goins <agoins@nvidia.com>
Date: Wed Apr 10 13:48:02 2019 -0500
xsync: Add resource inside of SyncCreate, export SyncCreate
But it added this field not at the end of SyncObject. It may not have
been _usefully_ possible to create those from another extension prior to
that commit, but that's still an ABI-incompatible change.
(cherry picked from commit 194ba38728b34a76885275dae153057c8afaf72e)
-
045add84
by Adam Jackson
at 2019-08-21T19:01:15Z
glx: Fix previous context validation in xorgGlxMakeCurrent
vnd has already verified that the context tag is valid before this gets
called, and we only set the context tag private data to non-null for
indirect clients. Mesa happens to be buggy and doesn't send MakeCurrent
requests nearly as much as it should for direct contexts, but if you fix
that, then unbinding a direct context would fail here with
GLXBadContextTag.
Sadly Mesa will still need to carry a workaround here for broken
servers, but we should still fix the server.
(cherry picked from commit 95dcc81cb122e5a4c5b38e84ef46eb872b2e1431)
-
e0af0906
by Carlos Garnacho
at 2019-09-10T12:50:52Z
xwayland: Separate DamagePtr into separate window data
This will be dissociated in future commits to handle the cases
where windows are being realized before there is a compositor
handling redirection.
In that case, we still want the DamagePtr to be registered upfront
on RealizeWindowProc before a corresponding xwl_window might be
created. Most notably, it cannot be lazily created on
SetWindowPixmapProc as damage accounting gets broken.
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
(cherry picked from commit 4e50440ae20c537d6a4edf356cda67dd33d4e5a8)
-
12db645c
by Carlos Garnacho
at 2019-09-10T12:50:57Z
xwayland: Refactor surface creation into a separate function
This is just called from xwl_window_realize() ATM, but will be useful in
future commits.
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
(cherry picked from commit c2e8ae964052944312c5023ca7ea5c41a92990e5)
-
63346c74
by Carlos Garnacho
at 2019-09-10T12:51:00Z
xwayland: Handle the case of windows being realized before redirection
If Xwayland gets to realize a window meant for composition before the
compositor redirected windows (i.e. redirect mode is not RedirectDrawManual
yet), the window would stay "invisible" as we wouldn't create a
wl_surface/wl_shell_surface for it at any later point.
This scenario may happen if the wayland compositor sets up a X11 socket
upfront, but waits to raise Xwayland until there are X11 clients. In this
case the first data on the socket is the client's, the compositor can hardly
beat that in order to redirect subwindows before the client realizes a
Window.
In order to jump across this hurdle, allow the late creation of a matching
(shell) surface for the WindowPtr on SetWindowPixmapProc, so it is ensured
to be created after the compositor set up redirection.
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
(cherry picked from commit 78cc8b6f9613fc71f6ecc7e8848d54364a250634)
-
5aadaac9
by Andres Rodriguez
at 2019-09-23T16:45:53Z
xf86: Disable unused crtc functions when a lease is revoked
This fixes 'non-desktop' displays staying powered on after their lease
has been revoked.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111620
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
-
c747dbb2
by Michel Dänzer
at 2019-09-26T16:26:45Z
miext/sync: Make struct _SyncObject::initialized fully ABI compatible
With a 32-bit build, putting the initialized field at the end of the
struct bumped the struct size from 20 bytes to 24, changing the layout
of other structs embedding struct _SyncObject. While this would be
acceptable on master, it caused crashes with 1.20.
Making the initialized field a char and putting it in the hole before
the beingDestroyed field restores the 32-bit ABI as well.
Fixes https://gitlab.freedesktop.org/xorg/xserver/issues/892
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Alex Goins <agoins@nvidia.com>
(cherry picked from commit 0d8cc7bb180468fee72330f40d87f6e9db7b42c0)
-
616b3e1d
by Samuel Thibault
at 2019-10-14T05:36:10Z
Fix crash on XkbSetMap
Since group_info and width are used for the key actions allocations,
when modifying them we need to take care of reallocation key actions if
needed.
(cherry picked from commit fabc4219622f3c0b41b1cb897c46e092377059e3)
-
b6ee04e7
by Samuel Thibault
at 2019-10-14T05:36:17Z
Fix crash on XkbSetMap
Some devices may not have keyboard information.
Fixes #574
(cherry picked from commit 8469bfead9515ab3644f1769a1ff51466ba8ffee)
-
9ee4e35b
by Eric Anholt
at 2019-10-29T22:01:20Z
shm: reindent shm_tmpfile to follow our standards.
Signed-off-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 804a9b4f57107fa2d0ed1ae0becda5bebaffe6e1)
-
05c5b970
by Eric Anholt
at 2019-10-29T22:01:20Z
shm: Pick the shm dir at run time, not build time.
Prodding the builder's filesystem for tmp dirs doesn't necessarily
tell you anything about what the actual host's filesystem is going to
look like, so we should just try the dirs at runtime.
Signed-off-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 19f6cb570becbc4e355807199c6e251fc7935132)
-
e815db54
by Alexander Volkov
at 2019-10-29T22:01:20Z
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>
(cherry picked from commit f6753c117ef0f83499d5e2d6dda226fec9ddf803)
-
fada61e8
by Matt Turner
at 2019-10-29T22:01:20Z
dix: Assert noPanoramiXExtension is false in PanoramiX code
When compiling with link time optimization, GCC thinks it's discovered
undefined behavior:
events.c: In function 'XineramaConfineCursorToWindow':
events.c:609:13: warning: iteration 2147483647 invokes undefined behavior [-Waggressive-loop-optimizations]
events.c:609:11: note: within this loop
events.c:605:49: warning: array subscript -1 is below array bounds of 'struct _Window *[16]' [-Warray-bounds]
events.c:606:31: warning: array subscript -1 is below array bounds of 'struct _Screen *[16]' [-Warray-bounds]
events.c:610:39: warning: array subscript -2 is below array bounds of 'struct _Screen *[16]' [-Warray-bounds]
events.c:617:38: warning: array subscript -2 is below array bounds of 'struct _Window *[16]' [-Warray-bounds]
events.c:619:35: warning: array subscript -2 is below array bounds of 'struct _Screen *[16]' [-Warray-bounds]
This results from
i = PanoramiXNumScreens - 1;
RegionCopy(&pSprite->Reg1, &pSprite->windows[i]->borderSize);
off_x = screenInfo.screens[i]->x;
off_y = screenInfo.screens[i]->y;
where GCC believes that PanoramiXNumScreens might be 0. Unfortunately
GCC is just smart enough to be an annoyance because this case is not
actually possible: XineramaConfineCursorToWindow() is only called when
noPanoramiXExtension is false, and if noPanoramiXExtension is false then
PanoramiXNumScreens must be >1 (see PanoramiXExtensionInit()).
So, add an assert(!noPanoramiXExtension), which to my surprise provides
GCC with information even in release builds and lets GCC understand that
the code is not doing anything that is undefined behavior.
I chose this solution instead of the proposed assert(i >= 0) because the
same pattern occurs in CheckVirtualMotion() but is inside an
'if (!noPanoramiXExtension)' and does not generate any warnings.
Fixes: xorg/xserver#590
Signed-off-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 61aa40aeb3d4efefda47f245ed4b83a1a19b1d4c)
-
df1f8f69
by Alexander Tsoy
at 2019-10-29T22:01:20Z
configure: Set libdrm flags correctly if only XORG is enabled
This fixes modesetting driver build failure which can be triggered with
the following configure options:
$ ./configure --disable-dri --disable-dri2 --disable-dri3
--disable-config-udev --enable-xorg
Bugzilla: https://bugs.gentoo.org/689768
Signed-off-by: Alexander Tsoy <alexander@tsoy.me>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 334f1107146a2e6ebf6f7743b77aec2ad5c46f75)
-
3491f1dc
by Sven Joachim
at 2019-10-30T19:38:30Z
modesetting: Fix broken manpage in autoconf build
The autoconf build for the modesetting driver still relied on
xorg-macros.m4 for string replacements and did not include the
top-level manpages.am. As a result, no substitutions took place after
commit 2e497bf887aca832dc0dd30d071c5288ab5c1e15.
This should be a candidate for the 1.20 branch.
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
(cherry picked from commit de0d39f825cce7422986011ee9d5db91f15e2987)
-
a57729d3
by Marvin Schmidt
at 2019-11-05T16:12:03Z
build: glx: Lower gl version to work with libglvnd
When using mesa with libglvnd support, mesa will no longer install the
gl, glx, egl pkg-config files but instead let libglvnd provide them.
libglvnd maintainers decided to change the versioning as it was
mesa-specific previously. Now the libraries have versions of the API
they expose[1].
This causes problems when building the X server:
checking for glproto >= 1.4.17 gl >= 9.2.0... no
configure: error: Package requirements (glproto >= 1.4.17 gl >= 9.2.0) were not met:
Requested 'gl >= 9.2.0' but version of gl is 1.2
Lower the version requirement to 1.2 to allow building against libglvnd
provided libraries
[1] https://github.com/NVIDIA/libglvnd/commit/0dfaea2bcb7cdcc785f95e244223bd004a2d7fba
(cherry picked from commit e6ef2b12404dfec7f23592a3524d2a63d9d25802)
-
e16eb696
by Adam Jackson
at 2019-11-05T16:12:03Z
meson: Fix another reference to "gl" 9.2.0
Previous commit e6ef2b12 missed a spot.
(cherry picked from commit c7486613b0dc586f93f6ba293d9b55c69995b05c)
-
2f55e8dc
by Adam Jackson
at 2019-11-05T16:12:03Z
meson: Apparently 1.2 is < 1.2.0
Siiiigh.
(cherry picked from commit 3340ddf37743fdf197dfc16a97107435ff53c6e4)
-
642c1f83
by Hans de Goede
at 2019-11-05T16:12:03Z
glamor/xwayland: Define EGL_NO_X11
Define EGL_NO_X11 everywhere were we also define MESA_EGL_NO_X11_HEADERS,
EGL_NO_X11 is the MESA_EGL_NO_X11_HEADERS equivalent for the egl headers
shipped with libglvnd.
This fixes the xserver not building with the libglvnd-1.2.0 headers:
In file included from /usr/include/EGL/eglplatform.h:128,
from /usr/include/epoxy/egl_generated.h:11,
from /usr/include/epoxy/egl.h:46,
from glamor_priv.h:43,
from glamor_composite_glyphs.c:25:
/usr/include/X11/Xlib.h:222:2: error: conflicting types for 'GC'
222 | *GC;
| ^~
In file included from glamor.h:34,
from glamor_priv.h:32,
from glamor_composite_glyphs.c:25:
../include/gcstruct.h:282:3: note: previous declaration of 'GC' was here
282 | } GC;
| ^~
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 741bd73429e337071f49509ddcc5fb392e20b0f6)
-
2dd9dfc8
by Alex Goins
at 2019-11-11T22:46:32Z
randr: Fix RRCrtcDetachScanoutPixmap() segfault during server teardown
During server teardown, mrootdraw is NULL, which can cause segfaults if
master->Stop{,Flipping}PixmapTracking() don't do NULL checking. In this case we
shouldn't need to do master->Stop{,Flipping}PixmapTracking() anyway, so just
skip it.
Signed-off-by: Alex Goins <agoins@nvidia.com>
(cherry picked from commit c82f814313a813d7e1a2d7d3b1f7561810446b34)
-
341a4787
by Alex Goins
at 2019-11-11T22:46:32Z
modesetting: Fix ms_covering_crtc() segfault with non-modesetting slave primary
ms_covering_crtc() uses RRFirstOutput() to determine a primary output to fall
back to if a drawable is overlapping a slave output.
If the primary output is a slave output, RRFirstOutput() will return a slave
output even if passed a master ScreenPtr. ms_covering_crtc() dereferences the
output's devPrivate, which is invalid for non-modesetting outputs, and can
crash.
Changing RRFirstOutput() could have unintended side effects for other callers,
so this change replaces the call to RRFirstOutput() with ms_first_output().
ms_first_output() ignores the primary output if it doesn't match the given
ScreenPtr, choosing the first connected output instead.
Signed-off-by: Alex Goins <agoins@nvidia.com>
(cherry picked from commit 3ef9029ace4245d9f8929aa71e22bc6a6f40b7b3)
-
aa43dce1
by Alex Goins
at 2019-11-11T22:46:32Z
modesetting: Fix ms_covering_crtc() segfault with non-xf86Crtc slave
DIX ScreenRecs don't necessarily have an xf86CrtcConfigPtr DDX private.
ms_covering_crtc() assumes that they do, which can result in a segfault.
Update ms_covering_crtc() to check the XF86_CRTC_CONFIG_PTR() returned pointer
before dereferencing it. This will still mean that ms_covering_crtc() can't fall
back to the primary output when a drawable overlaps a slave output (going to the
1 FPS default instead), but it won't segfault.
Signed-off-by: Alex Goins <agoins@nvidia.com>
(cherry picked from commit 797e7a0ceb673fe2870c673e248835526a84d000)
-
325f694e
by Alex Goins
at 2019-11-11T22:46:32Z
modesetting: Implement ms_covering_randr_crtc() for ms_present_get_crtc()
ms_present_get_crtc() returns an RRCrtcPtr, but derives it from a xf86CrtcPtr
found via ms_dri2_crtc_covering_drawable()=>ms_covering_crtc(). As a result, it
depends on all associated DIX ScreenRecs having an xf86CrtcConfigPtr DDX
private.
Some DIX ScreenRecs don't have an xf86CrtcConfigPtr DDX private, but do have an
rrScrPrivPtr DDX private. Given that we can derive all of the information we
need from RandR, we can support these screens by avoiding the use of xf86Crtc.
This change implements an RandR-based path for ms_present_get_crtc(), allowing
drawables to successfully fall back to syncing to the primary output, even if
the slave doesn't have an xf86CrtcConfigPtr DDX private.
Without this change, if a slave doesn't have an xf86CrtcConfigPtr DDX private,
drawables will fall back to 1 FPS if they overlap an output on that slave.
Signed-off-by: Alex Goins <agoins@nvidia.com>
(cherry picked from commit 562c7888be538c4d043ec1f374a9d9afa0b305a4)
-
03b91e17
by Aaron Plattner
at 2019-11-13T18:33:50Z
xfree86: Call ScreenInit for protocol screens before GPU screens
During startup, the xfree86 DDX's InitOutput() calls PreInit for
protocol screens first, and then GPU screens. On teardown, dix_main()
calls CloseScreen in the reverse order: GPU screens first starting with
the last one and then working backwards, and then protocol screens also
in reverse order.
InitOutput() calls ScreenInit in the wrong order: for GPU screens first and then
for protocol screens. This causes a problem for drivers that have global state
that is tied to the first screen that calls ScreenInit.
Fix this by simply re-ordering the for loops to call PreInit for
protocol screens first and then for GPU screens second.
(cherry picked from commit e5e9a8ca91d1c087edd8788a110251ad940dbc94)
-
07efd81b
by Olivier Fourdan
at 2019-11-18T05:22:46Z
compiler.h: Do not include sys/io.h on ARM with glibc
<sys/io.h> on ARM hasn't worked for a long, long time, so it was removed
it from glibc upstream.
Remove the include to avoid a compilation failure on ARM with glibc.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/840
(cherry picked from commit fe4cd0e7f5c58fa94db36326aadc1bd4e6d73eba)
-
2320fd4b
by Adam Jackson
at 2019-11-18T19:23:15Z
mi: Add a default no-op miSourceValidate
Slightly simplifies the callers since they don't need to check for
non-NULL anymore.
I do extremely hate the workarounds here to suppress misprite taking the
cursor down though. Surely there's a better way.
[1.20: Do not in fact simplify the callers as above, since it would
change the ABI. - ajax]
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
(cherry picked from commit ff310903f34ac34c916ad74e919d1ac12aea4715)
-
68cfee97
by Adam Jackson
at 2019-11-18T19:23:38Z
dix: Call SourceValidate before GetImage
This ensures that any prep work for the drawable we're about to read
from is already done before we call down to GetImage. This should be no
functional change as most of the callers with a non-trivial
SourceValidate are already wrapping GetImage and doing the equivalent
thing, but we'll be simplifying that shortly.
More importantly this ensures that if any of that prep work would
generate events - like automatic compositing flushing rendering to a
parent pixmap which then triggers damage - then it happens entirely
before we start writing the GetImage reply header.
Note that we do not do the same for GetSpans, but that's okay. The only
way to get to GetSpans is through miCopyArea or miCopyPlane - where the
callers must already call SourceValidate - or miGetImage - which this
commit now protects with SourceValidate.
Fixes: xorg/xserver#902
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
(cherry picked from commit 516e75dbb6bbf97c7af9c2226242ffd9259fec11)
-
2edadf26
by Aaron Plattner
at 2019-11-20T19:18:28Z
os: Don't crash in AttendClient if the client is gone
If a client is in the process of being closed down, then its client->osPrivate
pointer will be set to NULL by CloseDownConnection. This can cause a crash if
freeing the client's resources results in a call to AttendClient. For example,
if the client has a pending sync fence:
Thread 1 "X" received signal SIGSEGV, Segmentation fault.
AttendClient (client=0x5571c4aed9a0) at ../os/connection.c:942
(gdb) bt
#0 AttendClient (client=0x5571c4aed9a0) at ../os/connection.c:942
#1 0x00005571c3dbb865 in SyncAwaitTriggerFired (pTrigger=<optimized out>) at ../Xext/sync.c:694
#2 0x00005571c3dd5749 in miSyncDestroyFence (pFence=0x5571c5063980) at ../miext/sync/misync.c:120
#3 0x00005571c3dbbc69 in FreeFence (obj=<optimized out>, id=<optimized out>) at ../Xext/sync.c:1909
#4 0x00005571c3d7a01d in doFreeResource (res=0x5571c506e3d0, skip=skip@entry=0) at ../dix/resource.c:880
#5 0x00005571c3d7b1dc in FreeClientResources (client=0x5571c4aed9a0) at ../dix/resource.c:1146
#6 FreeClientResources (client=0x5571c4aed9a0) at ../dix/resource.c:1109
#7 0x00005571c3d5525f in CloseDownClient (client=0x5571c4aed9a0) at ../dix/dispatch.c:3473
#8 0x00005571c3d55eeb in Dispatch () at ../dix/dispatch.c:492
#9 0x00005571c3d59e96 in dix_main (argc=3, argv=0x7ffe7854bc28, envp=<optimized out>) at ../dix/main.c:276
#10 0x00007fea4837cb6b in __libc_start_main (main=0x5571c3d1d060 <main>, argc=3, argv=0x7ffe7854bc28, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe7854bc18) at ../csu/libc-start.c:308
#11 0x00005571c3d1d09a in _start () at ../Xext/sync.c:2378
(gdb) print client->osPrivate
$1 = (void *) 0x0
Since the client is about to be freed, its ignore count doesn't matter and
AttendClient can simply be a no-op. Check for client->clientGone in AttendClient
and remove similar checks from two callers that had them.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
(cherry picked from commit 4308f5d3d1fbd0f5dce81e22c0c3f08c65a7c9d8)
-
0e601390
by Olivier Fourdan
at 2019-11-21T09:52:12Z
present/wnmd: Relax assertion on CRTC on abort_vblank()
Currently, the function `present_wnmd_abort_vblank()` would fail if the
given `crtc` is NULL.
However, `xwl_present_get_crtc()` can return `NULL` under some
circumstances, which would cause an unexpected termination of Xwayland
in such a case, caused by the assertion failure being triggered.
Remove the assertion, considering that the `crtc` isn't actually used in
neither `present_wnmd_abort_vblank()` nor `xwl_present_abort_vblank()`.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/937
(cherry picked from commit 4f984fc06bd57cabfa38f6191f10714878dc8969)
-
88f12aa7
by Matt Turner
at 2019-11-22T20:24:27Z
xfree86: Test presence of isastream()
isastream() was never more than a stub in glibc, and was removed in
glibc-2.30 by commit a0a0dc83173c ("Remove obsolete, never-implemented
XSI STREAMS declarations").
Bug: https://bugs.gentoo.org/700838
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit e6ab7f9f342f463092c45226f3294074351fdd5e)
-
6b3fafa9
by Matt Turner
at 2019-11-22T22:56:38Z
xserver 1.20.6
Signed-off-by: Matt Turner <mattst88@gmail.com>