summaryrefslogtreecommitdiff
path: root/hw/xwayland/xwayland-glamor.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-20xwayland: Move xwl_format array management to its own functionAustin Shafer1-19/+31
This creates xwl_add_format_and_mod_to_list, which is a helper that adds a format/mod combo to a xwl_format* list. This will be used by both the modifier event handling and the tranche format handling. Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2021-12-02xwayland/eglstream: Prefer EGLstream if availableOlivier Fourdan1-6/+2
Currently, when given the choice, Xwayland will pick the GBM backend over the EGLstream backend if both are available, unless the command line option “-eglstream” is specified. The NVIDIA proprietary driver had no support for GBM until driver series 495, but starting with the driver series 495, both can be used. But there are other requirements with the rest of the stack, typically Mesa, egl-wayland, libglvnd as documented in the NVIDIA driver. So if the NVIDIA driver series 495 gets installed, Xwayland will pick the GBM backend even if EGLstream is available and may fail to render properly. To avoid that issue, prefer EGLstream if EGLstream and all the Wayland interfaces are available, and fallback to GBM automatically unless “-eglstream” was specified. With this, the compositor, given the choice, can decide which actual backend Xwayland would use by advertising (or not) the Wayland "wl_eglstream_controller" interface. This change has no impact on compositors which do not have support for EGLstream in the first place. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Acked-by: Michel Dänzer <mdaenzer@redhat.com>
2021-12-02xwayland/glamor: Log backend selected for debugOlivier Fourdan1-0/+2
Add (verbose) statements to trace the actual backend used with glamor. That can be useful for debugging. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2021-12-01xwayland/glamor: Change errors to verbose messagesOlivier Fourdan1-2/+4
On a normal startup sequence, the Xwayland glamor backend would log an error whenever a required Wayland protocol is missing. Those are not really errors though, more informational messages along the glamor backend selection process. Demote those errors to verbose messages to reduce the verbosity of Xwayland at startup by default. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2021-11-04xwayland: Store EGLContext pointer in lastGLContextMichel Dänzer1-2/+4
We were storing the pointer to struct glamor_context. However, glamor itself is storing the EGLContext pointer since the commit below. Since the two values could never be equal, this resulted in constant superfluous eglMakeCurrent calls. The implicit glFlush triggered by those couldn't be good for performance. Fixes: 7c88977d338a "glamor: Store the actual EGL/GLX context pointer in lastGLContext" Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2021-06-14xwayland/present: Move wl_buffer check into xwl_glamor_check_flipMichel Dänzer1-0/+3
Keeps the glamor specific code together more. Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2021-05-11xwayland/glamor: Add return status to post_damageOlivier Fourdan1-2/+4
If the glamor backend failed to post damage, the caller should do the same to avoid a failure to attach the buffer to the Wayland surface. Change the API of Xwayland's glamor backend post_damage() to return a status so that xwl_window_post_damage() can tell whether the callee failed. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> https://gitlab.freedesktop.org/xorg/xserver/-/issues/1156
2021-04-09xwayland: implement pixmap_from_buffers for the eglstream backendErik Kurzinger1-12/+0
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>
2021-04-09xwayland: Add check_flip() glamor backend functionErik Kurzinger1-0/+11
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>
2021-04-09xwayland: move formats and modifiers functions to common glamor codeErik Kurzinger1-0/+111
This is preliminary work for hardware accelerated rendering with the NVIDIA driver. This moves the modifiers and formats functions previously only available to the GBM backend to the common glamor code so that it can be used by both the GBM and EGLStream backends. Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Acked-by: Olivier Fourdan <ofourdan@redhat.com> Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
2021-04-09xwayland: Move dmabuf interface to common glamor codeOlivier Fourdan1-5/+71
This is preliminary work for hardware accelerated rendering with the NVIDIA driver. The EGLStream backend can possibly also use the dmabuf interface, so move the relevant code from the GBM specific source to the common bits. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2021-01-08xwayland: remove unused parameter of xwl_glamor_pixmap_get_wl_bufferErik Kurzinger1-4/+2
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.
2020-09-22xwayland: Add a flag for n-buffers in EGL backendOlivier Fourdan1-0/+11
Using multiple window buffers crashes with EGLStream, which does not need it anyway as this is handled through EGL directly. Add a flag to the EGL backend to indicate whether it would benefit from multiple buffers and use this in the get_buffer() function. Thanks to Adam Jackson <ajax@redhat.com> for pointing out that issue with EGLStream. v2: Fix logical test (Adam Jackson <ajax@redhat.com>) Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2020-09-22xwayland: Add a flag to expose EGL backend featuresOlivier Fourdan1-0/+20
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>
2020-02-11Revert "xwayland/glamor-gbm: Add xwl_glamor_gbm_post_damage hook"Michel Dänzer1-1/+2
This reverts commit 9e85aa9c1fbf51ef00674e3a91aded4083a14a15. To be replaced with a better solution. Reviewed-by: Adam Jackson <ajax@redhat.com>
2020-01-31xwayland/glamor-gbm: Add xwl_glamor_gbm_post_damage hookMichel Dänzer1-2/+1
It flushes any pending drawing to the kernel, to make sure it'll be visible to the Wayland server. Without this, it was possible for the Wayland server to process surface commits before Xwayland got around to flushing the corresponding drawing, which could result in stale or even completely random window contents being visible. v2: * Make EGL backend post_damage hook mandatory, don't check for NULL in xwl_glamor_post_damage. (Olivier Fourdan) Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/951 Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2019-12-20xwayland: Cleanup and remove `xwayland.h`Olivier Fourdan1-4/+1
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>
2019-12-20xwayland: Move Xwayland GLX declarationOlivier Fourdan1-0/+1
Move the Xwayland GLX declaration to its own header file. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20xwayland: Separate Xwayland screen codeOlivier Fourdan1-0/+1
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>
2019-12-20xwayland: Move Xwayland windows to its own sourcesOlivier Fourdan1-0/+1
Over time, Xwayland main source file `xwayland.c` has grown in size which makes it look cluttered and harder to read. Move the code dealing with Xwayland window to its own source and header files. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20xwayland: Move GLAMOR declarations to their own headerOlivier Fourdan1-1/+6
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>
2019-11-04glamor/xwayland: Define EGL_NO_X11Hans de Goede1-0/+1
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>
2019-05-23xwayland: Add EGL-backed GLX providerAdam Jackson1-0/+7
Without this we're using driswrast to set up GLX visuals. This is unfortunate because llvmpipe does not expose multisample configs, so various apps that expect them will fail. With this we just query the capabilities of the EGL that's backing glamor, and reflect that to the GLX clients. This also paves the way for xserver to stop being a DRI driver loader, which is nice. Fixes: xorg/xserver#640 Fixes: xorg/xserver#643 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=98272 Reviewed-by: Olivier Fourdan <ofourdan@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-10-16xwayland: make a if noop clearer to the compiler/coverityPeter Hutterer1-3/+6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-25xwayland: Enable DRI3 for glamorOlivier Fourdan1-0/+1
glamor_fds_from_pixmap() will bail out early if DRI3 is not enabled, unfortunately Xwayland's glamor code would not set it as enabled which would lead to blank pixmaps when using texture from pixmap. Make sure to mark DRI3 as enabled from glamor_egl_screen_init() in Xwayland. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107287 Fixes: c8c276c956 ("glamor: Implement PixmapFromBuffers and BuffersFromPixmap") Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2018-06-21xwayland: mandatory EGL backend APIOlivier Fourdan1-7/+1
The API init_wl_registry() and has_wl_interfaces() are marked as being optional, but both GBM And EGLStream backends implement them so there is point in keeping those optional. Suggested-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2018-06-21xwayland: simplify xwl_glamor_pixmap_get_wl_buffer()Olivier Fourdan1-5/+1
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>
2018-06-21xwayland: refactor EGL backends for wayland registryOlivier Fourdan1-19/+75
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>
2018-06-21xwayland: move EGL backend init to glamorOlivier Fourdan1-0/+17
Move EGL backends initialization to its own function in xwayland-glamor.c Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-06-21xwayland: Add Wayland interfaces checkOlivier Fourdan1-0/+11
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>
2018-06-21xwayland: swap "name" and "id" in init_wl_registry()Olivier Fourdan1-1/+1
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>
2018-06-21xwayland: move glamor specific routinesOlivier Fourdan1-80/+0
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>
2018-06-21xwayland: "EGL_EXT_device_base" required for EGLStreamOlivier Fourdan1-0/+3
eglQueryDevicesEXT() would abort if the required extensions are not available, meaning that enabling “-eglstream” on a non-EGLStream capable hardware would lead to an abort(). Check that "EGL_EXT_device_base" extension is available and bail out early if not, so we don't abort() later in eglQueryDevicesEXT(). Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-30xwayland: Avoid using epoxy_has_egl()Adam Jackson1-2/+1
There's no real point - if we don't have EGL then the extension check is also going to fail - and the entrypoint is new in 1.5.0, which we don't need to require yet. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2018-04-24xwayland: Add glamor egl_backend for EGLStreamsLyude Paul1-2/+111
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 producer each frame. In order to pull this off, we add two different additional egl_backend hooks that GBM opts out of implementing: - egl_backend.allow_commits for holding off displaying any EGLStream backed pixmaps until the point where it's stream is completely initialized and ready for use - egl_backend.post_damage for blitting the content of the EGLStream surface producer before Xwayland actually damages and commits the wl_surface to the screen. The other big pitfall here is that using nvidia's wayland-eglstreams helper library is also not possible for the most part. All of it's API for creating and destroying streams rely on being able to perform a roundtrip in order to bring each stream to completion since the wayland compositor must perform it's job of connecting a consumer to each EGLstream. Because Xwayland has to potentially handle both responding to the wayland compositor and it's own X clients, the situation of the wayland compositor being one of our X clients must be considered. If we perform a roundtrip with the Wayland compositor, it's possible that the wayland compositor might currently be connected to us as an X client and thus hang while both Xwayland and the wayland compositor await responses from eachother. To avoid this, we work directly with the wayland protocol and use wl_display_sync() events along with release() events to set up and destroy EGLStreams asynchronously alongside handling X clients. Additionally, since setting up EGLStreams is not an atomic operation we have to take into consideration the fact that an EGLStream can potentially be created in response to a window resize, then immediately deleted due to another pending window resize in the same X client's pending reqests before Xwayland hits the part of it's event loop where we read from the wayland compositor. To make this even more painful, we also have to take into consideration that since EGLStreams are not atomic that it's possible we could delete wayland resources for an EGLStream before the compositor even finishes using them and thus run into errors. So, we use quite a bit of tracking logic to keep EGLStream objects alive until we know the compositor isn't using them (even if this means the stream outlives the pixmap it backed). While the default backend for glamor remains GBM, this patch exists for users who have had to deal with the reprecussion of their GPU manufacturers ignoring the advice of upstream and the standardization of GBM across most major GPU manufacturers. It is not intended to be a final solution to the GBM debate, but merely a baindaid so our users don't have to suffer from the consequences of companies avoiding working upstream. New drivers are strongly encouraged not to use this as a backend, and use GBM like everyone else. We even spit this out as an error from Xwayland when using the eglstream backend. Signed-off-by: Lyude Paul <lyude@redhat.com> Acked-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-24xwayland: Decouple GBM from glamorLyude Paul1-739/+21
This takes all of the gbm related code in wayland-glamor.c and moves it into it's own EGL backend for Xwayland, xwayland-glamor-gbm.c. Additionally, we add the egl_backend struct into xwl_screen in order to provide hooks for alternative EGL backends such as nvidia's EGLStreams. Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-10xwayland: zero num_formats from the startEmil Velikov1-6/+5
The caller may ignore the return value (will be addressed with later commit) so simply zero the count from the get-go. We're pretty much do so, in all cases but one :-\ Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10xwayland: zero num_modifiers from the startEmil Velikov1-10/+7
The caller may ignore the return value (will be addressed with later commit) so simply zero the count from the get-go. We're pretty much do so, in all cases but one :-\ Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10dri3: annotate fds/strides/offsets arrays as constEmil Velikov1-4/+4
It makes it perfectly clear that we should not be modifying them. Should help highlight issues like the one fixed with previous commit. Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10xwayland: don't close() fds we don't ownEmil Velikov1-2/+0
The glamor_pixmap_from_fds error path erroneously closes the fds. We don't own them, plus the caller closes them after the function in called. Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10dri3: annotate the dri3_screen_info data as constEmil Velikov1-1/+1
dri3_screen_info is the user provide dispatch. Something that we do not and should not change. When using the _ptr typecast + const the compiler barfs at us (rightfully so), so use the _rec one. [Silence a new const mismatch warning too - ajax] Fixes: 56313829886 ("dri3: Add DRI3 extension") Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-03-28xwayland: Add arguments to glamor_pixmap_get_wl_bufferRoman Gilg1-6/+17
Add arguments to give the caller more information and control over the creation of a wl_buffer with GBM, in particular let the caller determine the size of the buffer. Signed-off-by: Roman Gilg <subdiff@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-09glamor/xwayland: Add depth 30 format mapping for DRI 3.2 as well.Mario Kleiner1-0/+4
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-03-05glamor: Use gbm_bo_create_with_modifiers for internal pixmap allocationLouis-Francis Ratté-Boulianne1-3/+19
Using modifier might allow the driver to use a more optimal format (e.g. tiled/compressed). Let's try to use those if possible. v2: Don't filter out multi-plane modifiers Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05glamor: Implement GetSupportedModifiersLouis-Francis Ratté-Boulianne1-13/+122
Implement function added in DRI3 v1.1. A newest version of libepoxy (>= 1.4.4) is required as earlier versions use a problematic version of Khronos EXT_image_dma_buf_import_modifiers spec. v4: Only send scanout-supported modifiers if flipping is possible v5: Fix memory corruption in XWayland (uninitialized pointer) Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05glamor: Implement PixmapFromBuffers and BuffersFromPixmapLouis-Francis Ratté-Boulianne1-50/+169
It relies on GBM >= 17.1.0 where we can import BO with multiple planes and a format modifier (GBM_BO_IMPORT_FD_MODIFIER). v2: Properly free fds in Xwayland [Also add glamor_egl_ext.h to Makefile.am for distcheck's sake - ajax] Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05dri3: Add multi-planar/modifier buffer requestsLouis-Francis Ratté-Boulianne1-2/+2
Initial implementation for DRI3 v1.1. Only the DRI3 implementation is there, backends need to implement the proper hooks. Version is still set to 1.0 so clients shouldn't use the new requests yet. v2: Use depth/bpp instead of DRM formats in requests v3: Remove DMA fence requests from v1.1 Add screen/drawable modifier sets v4: Free array returned by 'get_drawable_modifiers()' v5: Fix FD leak Signed-off-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Acked-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-11-07xwayland: Stop printing the EGL versionAdam Jackson1-4/+0
It doesn't matter, none of this matters. Acked-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-09-13xwayland: add envvar XWAYLAND_NO_GLAMOROlivier Fourdan1-0/+7
Not all compositors allow for customizing the Xwayland command line, gnome-shell/mutter for example have the command line and path to Xwayland binary hardcoded, which makes it harder for users to disable glamor acceleration in Xwayland (glamor being used by default). Add an environment variable XWAYLAND_NO_GLAMOR to disable glamor support in Xwayland. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-06-02glamor: Drop glamor_set_screen_pixmap().Eric Anholt1-2/+0
All that was left here was updating the FBO's size. However, the FBO size was always set correctly already through glamor_set_pixmap_texture() from whoever had attached a new BO to the pixmap. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>