- Aug 07, 2024
-
-
Olivier Fourdan authored
Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Part-of: <!1638>
-
- Aug 06, 2024
-
-
The code here assumed a `leave` event always occurs between two `enter` events. On Sway (and presumably other compositors) this happens even if the client has destroyed the `wl_surface`, but the client gets a null `surface` here. (Which presumably on on the wire is the id of the destroyed surface.) This seems like a bad thing to rely on, and is easy to avoid. But if this is correct to assume, the Wayland protocol should be explicit about this. (cherry picked from commit 386b54fb) Part-of: <!1635>
-
Olivier Fourdan authored
Now that we won't enable DRI3 if <sys/eventfd.h> is not available, there is not point in trying to include that header without DRI3. That allows to build Xwayland with GLAMOR enabled (without DRI3) on platforms which do not support eventfd. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 23c295ea) Part-of: <!1635>
-
Olivier Fourdan authored
DRI3 version 1.4 which supports explicit buffers synchronization relies on the eventfd interface. As result, building would fail with DRI3 enabled on platforms without the eventfd interface. Check for the availability of the sys/eventfd.h header and disable DRI3 support if missing. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 96bdc156) Part-of: <!1635>
-
Olivier Fourdan authored
Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Closes: #1668 (cherry picked from commit a58352b9) Part-of: <!1635>
-
This rewrites the shader so that we use the same (more flexible) CSC as we have for I420 and NV12. This also fixes the reverse of odd/even which caused chroma shift. Signed-off-by:
Nicolas Dufresne <nicolas.dufresne@collabora.com> (cherry picked from commit 39c8a6f3) Part-of: <!1635>
-
UYVY videos should be aligned by 2 to avoid breakups in the shader Fixes: 832b392f - glamor: xv: enable UYVY acceleration Suggested-by:
Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by:
Konstantin <ria.freelander@gmail.com> (cherry picked from commit eb26f323) Part-of: <!1635>
-
Check actual BPP by render_format in upload_boxes, not by drawable BPP. It is required when we used different BPP formats for storing and rendering (for example, in the case of UYVY). The problem of UYVY size lies inside method of glamor downloading boxes. When we set GLAMOR_CREATE_FORMAT_CBCR, it actually uses 16-bit GL and Pixman formats, but before this change in glamor_download_boxes, that function deduces GL and Pixman formats from BPP, which is wrong in this case (will be deduced to 32). When GL and Pixman format BPP is identical to drawable BPP, this change does nothing, but when it is different - it will prioritize Pixman format, not the format deduced from BPP. Closes: #1730 Signed-off-by:
Konstantin Pugin <ria.freelander@gmail.com> (cherry picked from commit 75f56b79) Part-of: <!1635>
-
Olivier Fourdan authored
Currently, we would start dequeuing events as soon as a device is resumed, regardless of its capabilities. If the capabilities are not available, we would just fallback to the regular XTEST code path and not use input emulation. As a result, it is very likely that we shall lose the first events until the compositor resumes first a device with the requested capabilities. To avoid that issue, start emulating only once we have the requested capabilities, if they match the seat capabilities. Closes: #1732 Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 0525b9a5) Part-of: <!1635>
-
Olivier Fourdan authored
This is a small code refactoring to help with clarity, simply move the code from the switch case for device resume to a dedicated function. No functional change. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 68ec297e) Part-of: <!1635>
-
Olivier Fourdan authored
If glamor_link_glsl_prog() fails, we may jump to the failed code path which frees the variable vs_prog_string and fs_prog_string. But those variables were already freed just before, so in that case we end up freeing the memory twice. Simply move the free at the end of the success code path so we are sure to free the values only once, either in the successful of failed code paths. Fixes: 2906ee5e - glamor: Fix leak in glamor_build_program() Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 34ea0203) Part-of: <!1635>
-
Olivier Fourdan authored
Currently, we would log only the event type, use the libei API to also log the name in plain text, so we can quickly identify the events we're missing out. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 1a42fe40) Part-of: <!1635>
-
Olivier Fourdan authored
Although we do not do anything with that event, handle it so we don't end up in the "Unhandled event" territory. Closes: #1722 Fixes: a1333342 - xwayland: Add XTEST support using EIS Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit bfabd3bd) Part-of: <!1635>
-
Olivier Fourdan authored
Since commit d370f1e5, Xwayland can optionally be started rootful and fullscreen. To do so, it will setup a viewport to scale the root window to match the size of the output. However, if the rootful Xwayland window receives an xdg-surface configure event before the output definition is complete, as with e.g. the labwc Wayland compositor, we might end up trying to setup a viewport with a destination size of 0x0 which is a protocol violation, and that kills Xwayland. To avoid that issue, only setup the viewport if the output size is meaningful. Also, please note that once the output definition is complete, i.e. when the "done" event is eventually received, we shall recompute the size for fullscreen again, hence achieving the desired fullscreen state. Fixes: d370f1e5 - xwayland: add fullscreen mode for rootful Closes: #1717 Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 66f5e7e9) Part-of: <!1635>
-
Clears -Wcalloc-transposed-args warnings from gcc 14.1, such as: ../dix/main.c:165:42: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args] 165 | serverClient = calloc(sizeof(ClientRec), 1); | ^~~~~~~~~ ../dix/main.c:165:42: note: earlier argument should specify number of elements, later size of each element Signed-off-by:
Alan Coopersmith <alan.coopersmith@oracle.com> (cherry picked from commit 522f469f) Part-of: <!1635>
-
struct hostent->h_addr_list is of type char**, not const char**. GCC considers this an error when in C99 mode or later. Signed-off-by:
Joaquim Monteiro <joaquim.monteiro@protonmail.com> (cherry picked from commit 0ddcd878) Part-of: <!1635>
-
- Jul 10, 2024
-
-
Olivier Fourdan authored
Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Part-of: <!1602>
-
- Jul 09, 2024
-
-
Olivier Fourdan authored
Since commit 792758fa ("xwayland: Update lost focus on deactivation"), in rootful mode, if we receive an "activated" state from xdg-shell indicating that the surface is no longer active, we shall end up calling xwl_seat_leave_ptr(). But xwl_seat_leave_ptr() does not actually check whether the seat has pointer capabilities, and if not, get_pointer_device() will return NULL. As a result, we would crash using a NULL pointer in GetMaster(). This typically can happen when using Xwayland rootful on headless compositors such as "cage" which do not advertise any capabilities for the seat. To avoid the issue, simply check whether get_pointer_device() returns a valid non-null device and bail out early otherwise. Fixes: 792758fa - xwayland: Update lost focus on deactivation Closes: #1700 Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 72036261) Part-of: <!1592>
-
- Jul 04, 2024
-
-
With explicit buffer synchronization in use, the window buffers use a file descriptor for event notification to keep the buffer alive for synchronization purpose. When running rootful, the root window (which is visible) is destroyed directly from the resource manager on server reset, and the window buffer's eventfd will trigger after the window is destroyed, leading to a use after free and a crash of the xserver. To avoid the issue, check whether the window being destroyed is the root window in rootless mode, and make sure to force the disposal of the window buffers in that case. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Closes: #1699 (cherry picked from commit a5e86396) Part-of: <!1569>
-
For cases (to come) where we would want to force the disposal of the window buffers, add a parameter to force the disposal by calling dispose() directly instead of maybe_dispose(). Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit fa04e15a) Part-of: <!1569>
-
No functional change, this is just preparation work for the next commit. v2: Reshuffle functions (Michel) Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 571cb133) Part-of: <!1569>
-
Right now, we would dispose the xwl_window and all the data associated with it on unrealize. But not all window destruction go through the unrealize code path, for example when the root window (running rootful) is destroyed from the resource manager on server reset, we do not get to the unrealize window step, but straight to destroy window. As a result, we are leaking the xwl_window and all the data associated with it, for example: | 65,536 bytes in 1 blocks are possibly lost in loss record 12,462 of 12,488 | at 0x484A0FC: calloc (vg_replace_malloc.c:1675) | by 0x48B661C: UnknownInlinedFun (pixman-bits-image.c:1273) | by 0x48B661C: _pixman_bits_image_init (pixman-bits-image.c:1296) | by 0x48B6754: create_bits_image_internal (pixman-bits-image.c:1349) | by 0x64180DE: UnknownInlinedFun (cairo-image-surface.c:380) | by 0x64180DE: UnknownInlinedFun (cairo-image-surface.c:366) | by 0x64180DE: cairo_image_surface_create (cairo-image-surface.c:432) | by 0x6346B44: UnknownInlinedFun (libdecor-gtk.c:467) | by 0x6346B44: libdecor_plugin_gtk_frame_new (libdecor-gtk.c:546) | by 0x4B7F297: libdecor_decorate (libdecor.c:559) | by 0x42C6F3: xwl_create_root_surface (xwayland-window.c:1266) | by 0x42CD97: ensure_surface_for_window (xwayland-window.c:1466) | by 0x42D0D1: xwl_realize_window (xwayland-window.c:1560) | by 0x50858F: compRealizeWindow (compwindow.c:279) | by 0x4FF2A2: MapWindow (window.c:2706) | by 0x4F9E7F: InitRootWindow (window.c:697) To avoid that issue, check whether there is still an xwl_window associated with the X11 window on destroy, and if that's the case, dispose the xwl_window. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 0e1a98f5) Part-of: <!1569>
-
No functional change intended, this is just preparation work for the next commit. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 74be7a7f) Part-of: <!1569>
-
The wp_linux_drm_syncobj_v1 protocol states that : | If at surface commit time there is a pending buffer attached but no | pending release timeline point set, the no_release_point protocol | error is raised. So we need to set a release timeline point in any case from the swap pixmap routine, even for the early out code paths. Failing to do so may cause a Wayland protocol error that is fatal to the Wayland client, in this case Xwayland: | wp_linux_drm_syncobj_surface_v1: error 4: No Acquire point provided | (EE) failed to dispatch Wayland events: Protocol error Closes: #1688 Fixes: 87bf2caf - xwayland: add support for wp_linux_drm_syncobj_v1 Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit bc9bf563) Part-of: <!1569>
-
Move the code which takes care of submitting pixmaps and the synchronization points to its own function. This will allow to reuse that code from different code path. No functional change intended. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 33330f0d) Part-of: <!1569>
-
The function xwl_window_swap_pixmap() can be called from two places, either from xwl_window_attach_buffer() or from damage_report(). When called from xwl_window_attach_buffer(), the new buffer is attached and the surface committed. However, when called from damage_report(), a new buffer might not be attached before the surface is committed. That's fine with implicit synchronization, but if we use explicit synchronization, committing a surface without a new buffer attached but with a release timeline point set is a protocol error: | If at surface commit time there is a pending release timeline point | set but no pending buffer attached, a no_buffer error is raised. To avoid such an issue, add a new parameter to xwl_window_swap_pixmap() to hint whether it should set the synchronization points, and have the synchronization points set only from xwl_window_attach_buffer(). v2: Rename param to handle_sync (Michel) Suggested-by:
Michel Dänzer <mdaenzer@redhat.com> Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit aab01c73) Part-of: <!1569>
-
Now that we have the buffer synchronization implemented in the GLAMOR/GBM code, switch to use that code. At this point, there is still not functional change intended, this is still preparation work for a fix that is still to come. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 256cef8b) Part-of: <xorg/xserver!1569>
-
Copy the code to deal with synchronization objects from the window buffers to the GLAMOR/GBM code. The idea is to deal with synchronizations for all pixmaps, even when there is no window buffer involved. This is still preparation work for the following commits, no functional change intended at this point. v2: Use a "xwl_window_buffer *" instead of a "void *data" (Michel) v3: Bail early if there's no xwl_window_buffer (Michel) v4: Rename xwl_window_submit_pixmap() to xwl_glamor_gbm_wait_release_fence() (Michel) Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit cc021aca) Part-of: <!1569>
-
We want to decorrelate the explicit buffer synchronization from the window buffers, and move that to the GLAMOR/GBM code instead. To do that, we need to be able to invoke the xwl_window_buffer's release_callback() routine from outside the window buffer code. For that purpose, introduce xwl_window_buffer_release() which calls xwl_window_buffer_release_callback() for us. This is preparation work for the following changes, no functional change intended at this point. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit b5082073) Part-of: <!1569>
-
Make the (opaque) definition of the xwl_window_buffer generally available. No functional change. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 0e0472a0) Part-of: <!1569>
-
If a child window of the same size is unmapped, we should stop walking the tree looking for the surface window to use. Whatever lies beneath is not visible anyway. This also fixes an issue with the Damage list becoming corrupted when destroying a window, because the first thing that DeleteWindow() does is to unmap the window and crush the window tree underneath it. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com> Fixes: 3a0fc268 - xwayland: Add xwl_window::surface_window Closes: #1680 (cherry picked from commit 32e16082) Part-of: <!1569>
-
While walking the window tree looking for the surface window to use, we should ignore windows using manual redirection. If a client manually redirects a window, it has control over how the contents of that window are presented. It's not safe to present them directly to the Wayland compositor. v2: break instead of continue, reword commit message (Michel) Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com> Fixes: 3a0fc268 - xwayland: Add xwl_window::surface_window Closes: xorg/xserver#1677 Closes: xorg/xserver#1679 (cherry picked from commit 0509b13f) Part-of: <xorg/xserver!1569>
-
Function `xwl_glamor_gbm_init_main_dev` does not check whether `xwl_screen->default_feedback.main_dev` a.k.a. `main_dev` is a valid pointer. This result in some special situation where main linux-dmabuf device is not accessible, such as KWin nested desktop, raising segment fault. This commit add a null pointer check to prevent crashing. Signed-off-by:
Chenx Dust <chenx_dust@outlook.com> Closes: #1683 Fixes: d7f1909e - xwayland/glamor/gbm: make wl_drm optional See-also: https://bugzilla.redhat.com/2284141 (cherry picked from commit 76058333) Part-of: <!1569>
-
Noticed this after trying to update to xorg-server-xwayland-24.1.0 in void linux https://github.com/void-linux/void-packages/pull/50457 Signed-off-by:
Fotios Valasiadis <fvalasiad@gmail.com> (cherry picked from commit af6180b2) Part-of: <!1569>
-
Before this change, the xwayland pkgconfig file will always contain an includedir directive, even though xwayland is not a linkable shared library: prefix=/nix/store/3spcjqp5zcyg8arz6dnsj59fal5yk3jy-xwayland-23.2.6 includedir=${prefix}/include exec_prefix=${prefix} xwayland=/nix/store/3spcjqp5zcyg8arz6dnsj59fal5yk3jy-xwayland-23.2.6/bin/Xwayland […] Cflags: -I${includedir} According to a bug reporter this trips up cmake [1], which expects that the include directory exists, which it does not since xwayland does not install any header files. Add the dataonly directive to pkgsconfig.generate() which will remove the default "." subdir and ensures that includedir is not set inside the pkgconfig file. Additionally enforce the install directory to $libdir/pkgconfig, since it otherwise will be installed to $datadir/pkgconfig, which precludes programs from finding the pkgconfig because share/pkgconfig is usually not included in the search path. The resulting pkgconfig does not contain an includedir: prefix=/nix/store/p7xhdzl65hfhzf36vxykzp2i9cyy7y6c-xwayland-23.2.6 exec_prefix=${prefix} xwayland=/nix/store/p7xhdzl65hfhzf36vxykzp2i9cyy7y6c-xwayland-23.2.6/bin/Xwayland have_glamor=true have_eglstream=true have_initfd=true have_listenfd=true have_verbose=true have_terminate_delay=true have_no_touch_pointer_emulation=true have_force_xrandr_emulation=true have_geometry=true have_fullscreen=true have_host_grab=true have_decorate=false have_enable_ei_portal=true have_byteswappedclients=true Name: Xwayland Description: X Server for Wayland Version: 23.2.6 [1]: https://github.com/NixOS/nixpkgs/pull/309075#issuecomment-2108381428 Signed-off-by:
Rouven Czerwinski <rouven@czerwinskis.de> Reviewed-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 9df084c8) Part-of: <!1569>
-
Signed-off-by:
Matthieu Herrb <matthieu@herrb.eu> (cherry picked from commit 89c3f35d) Part-of: <!1569>
-
- May 15, 2024
-
-
Olivier Fourdan authored
Xwayland 24.1.0 final release Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Part-of: <xorg/xserver!1545>
-
- May 13, 2024
-
-
Olivier Fourdan authored
This restores the handling of the XRandR emulation for Xwayland rootless where it was before commit fa7b1c20. Some compositors may trigger a protocol error if the viewport source is larger than the actual window size, having that handled in the window resize hook makes sure we do not regress. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 702a419c) Part-of: <!1535>
-
Olivier Fourdan authored
Commit fa7b1c20 ("xwayland: Use ConfigNotify screen hook instead of ResizeWindow") replaced the WindowResize hook with ConfigNotify. However, that's breaking rootful Xwayland with libdecor because the root window size is already set so the libdecor size is not updated, and the root size will be reverted back as soon as the focus changes. Reinstate the rootful size change in ResizeWindow to avoid that issue. Closes: #1669 Closes: #1671 Fixes: fa7b1c20 - xwayland: Use ConfigNotify screen hook instead of ResizeWindow Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 31d6f999) Part-of: <!1535>
-
Olivier Fourdan authored
For now it just chains to ResizeWindow hook. This is preparation work for the next commit, no functional change. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 539859bd) Part-of: <xorg/xserver!1535>
-