- 29 Apr, 2021 1 commit
-
-
Erik Kurzinger authored
If a window is being used for direct rendering with OpenGL or Vulkan, and is using the flipping path for presentation, it's pixmap will be set to a dma-buf backed pixmap created by the client-side GL driver. However, this means that xwl_glamor_eglstream_post_damage won't work since it requires that the pixmap has an EGLSurface that it can render to, which dma-buf backed pixmaps do not. In this case, though, xwl_glamor_eglstream_post_damage is not necessary since glamor will have rendered directly to the pixmap, so we can simply pass it directly to the compositor. There's no need for the intermediate copy we normally do in that function. Therefore, this change adds an early-return case to post_damage for dma-buf backed pixmaps, and removes the corresponding asserts from that function and allow_commits. Signed-off-by:
Erik Kurzinger <ekurzinger@nvidia.com> Acked-by:
Olivier Fourdan <ofourdan@redhat.com>
-
- 09 Apr, 2021 2 commits
-
-
Provides an implementation for the pixmap_from_buffers DRI3 function for xwayland's eglstream backend. This will be used by the NVIDIA GLX driver to pass buffers from client applications to the server. These can then be presented using the PRESENT extension. To hopefully make this less error-prone, we also introduce a "type" field for this struct to distinguish between xwl_pixmaps for the new DRI3-created pixmaps and those for the existing glamor-created pixmaps. Additionally, the patch enables wnmd present mode with the eglstream backend. This involves creating a wl_buffer for the provided dma-buf before importing it into EGL and passing this to the compositor so it can be scanned out directly if possible. Since both backends now support this present mode, the HAS_PRESENT_FLIP flag is no longer needed, so it can be removed. Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com> Acked-by:
Olivier Fourdan <ofourdan@redhat.com> Signed-off-by:
Erik Kurzinger <ekurzinger@nvidia.com>
-
This is preliminary work for hardware accelerated rendering with the NVIDIA driver. This exposes a new glamor backend function, check_flip, which can be used to control whether flipping is supported for the given pixmap. Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com> Acked-by:
Olivier Fourdan <ofourdan@redhat.com> Signed-off-by:
Erik Kurzinger <ekurzinger@nvidia.com>
-
- 08 Jan, 2021 1 commit
-
-
Erik Kurzinger authored
There are currently no callers that make use of the "created" output parameter of xwl_glamor_pixmap_get_wl_buffer. Remove it, along with the corresponding argument of the associated EGL backend entrypoint.
-
- 23 Nov, 2020 1 commit
-
-
Olivier Fourdan authored
EGLStream implementation in Xwayland keeps a list of pending streams for a window. If the windows's pixmap is destroyed while there is a pending stream, the pending stream will point to freed memory once the callback is triggered. Make sure to cancel the pending stream if there's one when the pixmap is destroyed. v2: * Use xorg_list_for_each_entry() instead of the safe variant (Michel Dänzer <mdaenzer@redhat.com>) Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Tested-by:
Karol Szuster <karolsz9898@gmail.com> Acked-by:
Michel Dänzer <mdaenzer@redhat.com> Closes xorg/xserver#1096
-
- 19 Nov, 2020 1 commit
-
-
Commit 77658741 - "xwayland: Add buffer release callback" added an API to deal with Wayland buffer release callbacks. The EGLstream implementation has its own wl_buffer callback, move that to the buffer release API instead so we don't have to deal with Wayland buffers directly and match the other Xwayland pixmap backend implementations. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com> Tested-by:
Erik Kurzinger <ekurzinger@nvidia.com>
-
- 30 Oct, 2020 1 commit
-
-
Adam Jackson authored
Instead, bump the pixmap's refcount at the bottom of post_damage to reflect the compositor's hold on the buffer, and "destroy" the pixmap in the buffer release callback (which will dec the pixmap's refcount and free if necessary). Signed-off-by:
Adam Jackson <ajax@redhat.com>
-
- 22 Sep, 2020 2 commits
-
-
The EGLStream backend keeps a queue of pending streams for each Xwayland window. However, when this pending queue is freed, the corresponding private data may not be cleared (typically if the pixmap for this window has changed before the compositor finished attaching the consumer for the window's pixmap's original eglstream), leading to a use-after-free and a crash when trying to use that data as the window pixmap. Make sure to clear the private data when the pending stream is freed. Closes: xorg/xserver#1055 Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Tested-by:
Karol Szuster <karolsz9898@gmail.com> Reviewed-by:
Adam Jackson <ajax@redhat.com>
-
Olivier Fourdan authored
The present flip does not work with the EGLStream backend. Similarly, the EGLStream backend does not require the buffer to be flushed as eglSwapBuffers() should take care of this. Instead of actually checking the backend in use in the present code, add a flag in the form of a bitfield to the EGL backend to indicate its features and requirements. This should not introduce any functional change. v2: Fix logical test (Adam Jackson <ajax@redhat.com>) Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Adam Jackson <ajax@redhat.com>
-
- 05 Jul, 2020 1 commit
-
-
Alan Coopersmith authored
Most (but not all) of these were found by using codespell --builtin clear,rare,usage,informal,code,names but not everything reported by that was fixed. Signed-off-by:
Alan Coopersmith <alan.coopersmith@oracle.com>
-
- 06 Jan, 2020 1 commit
-
-
Fixes build failure. Closes: xorg/xserver#954 Fixes: 89e32d00 "xwayland: Move Xwayland windows to its own sources" Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by:
Olivier Fourdan <ofourdan@redhat.com>
-
- 20 Dec, 2019 4 commits
-
-
Olivier Fourdan authored
Now that each source and header should be in order, we can safely cleaup the last remaining bits from the main `xwayland.h` which is not needed anymore and can be removed. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com>
-
Olivier Fourdan authored
Move Xwayland screen related code to a separate source file and header. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com>
-
Olivier Fourdan authored
Move Xwayland generic pixmap code to a separate source file and header. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com>
-
Olivier Fourdan authored
Currently, `xwayland.h` contains all the declarations, which is a bit awkward and hard to follow. Move the GLAMOR relevant declarations to their own header file. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com>
-
- 28 Nov, 2019 1 commit
-
-
Olivier Fourdan authored
The API `wl_buffer_add_listener` is misleading in the sense that there can be only one `wl_buffer` release callback, and trying to add a new listener when once is already in place will lead to a protocol error. The Xwayland EGL backends may need to set up their own `wl_buffer` release listener, meaning that there is no way to our own `wl_buffer` release callback. To avoid the problem, add our own callback API to be notified when the `wl_buffer` associated with an `xwl_pixmap` is released, triggered from the different `xwl_pixmap` implementations. Also update the Present code to use the new buffer release callback API. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com>
-
- 08 Nov, 2019 1 commit
-
-
Olivier Fourdan authored
The definition by the manual is `calloc(size_t nmemb, size_t size)`. Swap the arguments of calloc() calls to match the definition. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com>
-
- 04 Nov, 2019 1 commit
-
-
Hans de Goede authored
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>
-
- 16 Oct, 2018 1 commit
-
-
Peter Hutterer authored
Found by coverity Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- 21 Jun, 2018 6 commits
-
-
When retrieving the Wayland buffer from a pixmap, if the buffer already exists, the GBM backend will return that existing buffer. However, as seen with the Present issues, if the call had previously passed a wrong size, that buffer will remain at the wrong size for as long as the buffer exists, which is error prone. Considering that the width/height passed to get_wl_buffer() is always the actual pixmap drawable size, and considering that the EGLStream backend makes no use of the size either, there is really no point in passing the width/height around. Simplify the xwl_glamor_pixmap_get_wl_buffer() and EGL backends API by removing the pixmap size, and use the drawable size instead. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com>
-
xwl_glamor_eglstream_init_egl() uses "EGL_IMG_context_priority" extension, make sure it's actually available before using it. Suggested-by:
Emil Velikov <emil.velikov@collabora.com> Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Emil Velikov <emil.velikov@collabora.com>
-
To be able to check for availability of the Wayland interfaces required to run a given EGL backend (either GBM or EGLStream for now), we need to have each backend structures and vfuncs in place before we enter the Wayland registry dance. That basically means that we should init all backends at first, connect to the Wayland compositor and query the available interfaces and then decide which backend is available and should be used (or none if either the Wayland interfaces or the EGL extensions are not available). For this purpose, hold an egl_backend struct for each backend we are to consider prior to connect to the Wayland display so that, when we get to query the Wayland interfaces, everything is in place for each backend to handle the various Wayland interfaces. Eventually, when we need to chose which EGL backend to use for glamor, the available Wayland interfaces and EGL extensions available are all known to Xwayland. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Emil Velikov <emil.velikov@collabora.com>
-
Introduces a new egl_backend function to let the EGL backend check for the presence of the required Wayland interfaces. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Emil Velikov <emil.velikov@collabora.com>
-
Both xwl_glamor_init_wl_registry() and the Wayland global registry handler use the interface id/name in that order, using name/id in the egl_backend vfunc makes things confusing and error prone. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Emil Velikov <emil.velikov@collabora.com>
-
Functions such as: xwl_glamor_egl_supports_device_probing() xwl_glamor_egl_get_devices() xwl_glamor_egl_device_has_egl_extensions() Are of no use outside of EGLStream support, move them to the relevant source file. Similarly, the other glamor functions such as: xwl_glamor_init() xwl_screen_set_drm_interface() xwl_screen_set_dmabuf_interface() xwl_glamor_pixmap_get_wl_buffer() xwl_glamor_init_wl_registry() xwl_glamor_post_damage() xwl_glamor_allow_commits() xwl_glamor_egl_make_current() Are useless without glamor support enabled, move those within a a "#ifdef XWL_HAS_GLAMOR" in xwayland.h Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Emil Velikov <emil.velikov@collabora.com>
-
- 24 Apr, 2018 1 commit
-
-
This adds initial support for displaying Xwayland applications through the use of EGLStreams and nvidia's custom wayland protocol by adding another egl_backend driver. This also adds some additional egl_backend hooks that are required to make things work properly. EGLStreams work a lot differently then the traditional way of handling buffers with wayland. Unfortunately, there are also a LOT of various pitfalls baked into it's design that need to be explained. This has a very large and unfortunate implication: direct rendering is, for the time being at least, impossible to do through EGLStreams. The main reason being that the EGLStream spec mandates that we lose the entire color buffer contents with each eglSwapBuffers(), which goes against X's requirement of not losing data with pixmaps. no way to use an allocated EGLSurface as the storage for glamor rendering like we do with GBM, we have to rely on blitting each pixmap to it's respective EGLSurface produ...
-