Age | Commit message (Collapse) | Author | Files | Lines |
|
Prevents Xwayland with glamor from logging
unexpected depth: 15
to stderr many times when running
rendercheck -t blend -o clear
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1507>
|
|
hw/xwayland/xwayland-glamor-gbm.c:38:10: fatal error: 'linux/dma-buf.h' file not found
38 | #include <linux/dma-buf.h>
| ^~~~~~~~~~~~~~~~~
Fixes: 3df236a3d538 ("xwayland: add functions to import and export dma-buf implicit fences")
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1481>
|
|
It may track a non-toplevel window which fully covers the area of the
window pixmap / Wayland surface. It is now used instead of
xwl_window::toplevel for updating the Wayland surface contents.
The surface_window can now hit the Present page flip path while it's
automatically redirected.
v2:
* Use "surface_window" instead of "surf_win". (Olivier Fourdan)
* Add comment describing surface_window, and describe what
surface_window/toplevel are useful for respectively. (Olivier Fourdan)
* Use surface_window in xwl_realize_window.
v3:
* Backtrack up to the closest opaque ancestor in
xwl_window_update_surface_window. (Olivier Fourdan)
v4:
* Clean up logic for determining the surface window in
xwl_window_update_surface_window, and document it better.
* Handle window_get_damage(xwl_window->surface_window) returning NULL
in xwl_window_update_surface_window.
* Call xwl_window_update_surface_window after xwl_window_buffers_init
in ensure_surface_for_window, since the former may call
xwl_window_buffers_dispose.
* Rename surf/win_pix to surface/window_pixmap in
xwl_window_update_surface_window.
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1300>
|
|
Preparation for later changes, no functional change intended.
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1300>
|
|
It's always the toplevel window, i.e. either the root window or a child
of it.
Preparation for later commits, no functional change.
v2: (Olivier Fourdan)
* Fix debug build.
* Add comment describing ::toplevel.
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1300>
|
|
This protocol allows for explicit synchronization of GPU operations by
Wayland clients and the compositor. Xwayland can make use of this to
ensure any rendering it initiates has completed before the target image
is accessed by the compositor, without having to rely on kernel-level
implicit synchronization.
Furthermore, for X11 clients that also support explicit synchronization
using the mechanisms exposed in the DRI3 and Present extensions, this
Wayland protocol allows us to simply forward the timeline, acquire, and
release points directly to the compositor, ideally avoiding any
premature stalls in the presentation pipeline.
Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/967>
|
|
Together, DRI3 1.4 and Present 1.4 allow clients to explicitly
synchronize GPU rendering with presentation using DRM syncobjs. Here we
add the necessary support to Xwayland's glamor and Present
infrastructure to enable this functionality.
Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/967>
|
|
Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/967>
|
|
Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/967>
|
|
We have only one backend now.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
|
|
This is a preliminary step to remove the backend's field "is_available".
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
|
|
We do not need these anymore, since we only have the GBM backend left.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
|
|
And rename the function xwl_glamor_gbm_create_pixmap_for_window() as
xwl_glamor_create_pixmap_for_window().
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
|
|
Call xwl_gbm_get_main_device() directly from xwl_screen_get_main_dev().
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
|
|
The GBM backend never had a use for it.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
|
|
And rename the GLAMOR GBM xwl_glamor_gbm_get_wl_buffer_for_pixmap()
function as xwl_glamor_pixmap_get_wl_buffer().
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
|
|
And call xwl_glamor_gbm_init_screen() directly instead.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
|
|
And call xwl_glamor_gbm_init_egl() directly instead.
Yet, keep the function separate rather than merging it back into
xwl_glamor_init() for clarity of the code.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
|
|
And merge it back into xwl_glamor_has_wl_interfaces()
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
|
|
And merge it back into xwl_glamor_init_wl_registry().
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
|
|
No need to call is_device_path_render_node() on each node, the
index is the node type. Saves a couple of open()/close()/IOCTLs.
Signed-off-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1237>
|
|
Otherwise the pixmap is too small for a window with non-0 border width.
Fixes: 9730fb64ea05 ("xwayland: Add create_pixmap_for_window() to GBM backend")
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1314>
|
|
These are already defined in glamor.h
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1274>
|
|
Build on top of [1] to use linux-dmabuf to grab the main device
when wl_drm is unavailable. Fixes Xwayland glamor on top of latest
wlroots commit which has dropped wl_drm support [2].
[1]: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/818
[2]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4397
Signed-off-by: Simon Ser <contact@emersion.fr>
|
|
This makes it more obvious what the values mean.
Signed-off-by: Simon Ser <contact@emersion.fr>
|
|
The Wayland interfaces have a "name" field that we can use instead of
hardcoding their name.
Change the code to use that name instead of the static strings.
This was inspired by a similar change in mutter by Robert Mader
<robert.mader@collabora.com>.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
This will force Glamor run on GL or GL ES independently from GL version set.
Signed-off-by: Konstantin <ria.freelander@gmail.com>
|
|
This replaces int glamor parameter with a new enum to be more clean
and prepare for more glamor options.
No functional change.
Signed-off-by: Konstantin <ria.freelander@gmail.com>
|
|
On Mesa, when we request GBM_FORMAT_XRGB8888, driver set surface storage
format to GL_RGB8, which breaks GL ES rendering (on any GL ES version).
If we force set gbm_format to GBM_FORMAT_ARGB8888, then rendering
will happen and working.
Fixes #1288
Fixes #1356
|
|
Some drivers might not support explicit format modifiers. On these
drivers `gbm_bo_create_with_modifiers()` will fail and the
`gbm_bo_create()` code path will be used instead.
In this case, if the LINEAR modifier is advertised (and the INVALID
modifier is not) add the `GBM_BO_USE_LINEAR` flag.
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1438
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: José Expósito's avatarJosé Expósito <jexposit@redhat.com>
|
|
This is required per
https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_image_pixmap.txt .
Mesa hasn't enforced it, but it will soon:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/454
Fixes: 2f113d68f6c1 ("xwayland: Add glamor and DRI3 support")
|
|
If the format and modifiers are from a tranche which supports scanout,
we can set the corresponding flag to gbm_bo_create_with_modifiers2() to
benefit from scanout buffers where applicable.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
|
This allows us to pass flags to the function, avoiding the forced
implicit GBM_BO_USE_SCANOUT which happens with the older version.
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
|
Before linux_dmabuf v4 support was added, the BO were created using
gbm_bo_create_with_modifiers() which incidentally creates scanout
capable buffers.
We now need to replicate that explicitly when using the fallback path,
with buffers window, otherwise direct scanout will not be possible in
that case.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1535
Suggested-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
|
Add the implementation for create_pixmap_for_window() in the GBM glamor
backend.
To do so, we just rename the existing xwl_glamor_gbm_create_pixmap() as
internal and add an optional drawable parameter, so that it can be used
either from the regular CreatePixmap code path, or from the new direct
Xwayland glamor's hook.
v2: Fallback to xwl_glamor_get_modifiers() if
xwl_glamor_get_drawable_modifiers() returned 0 modifiers. (Michel)
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
|
If we allocated with implicit modifiers, then we shouldn't use the
modifier returned by gbm_bo when checking whether the modifier is
supported or not, since it won't be if the compositor only advertises
implicit modifiers, nor should we use the modifier when creating the
Wayland buffer object, as it wasn't explicitly advertised.
Fixes: c6f2598a4 ("xwayland: don't fall back to wl_drm with explicit modifier")
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
|
|
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
|
|
This is preparing for cleaning up the macro mess.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
|
|
If we're using implicit modifiers, we'll pass NULL and zero modifiers.
Lets just use the legacy API directly instead.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
|
|
The linux_dmabuf_v1 protocol doesn't guarantee any DRM node type:
the compositor may send a primary node or a render node. Use
drmDevice so that device comparisons are node-type-insensitive.
Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1447
|
|
It's incorrect to strip an explicit modifier. Daniels' docs [1]
states:
> when importing a buffer, the user may supply `DRM_FORMAT_MOD_INVALID` as the
> buffer modifier (or not supply a modifier) to indicate that the modifier is
> unknown for whatever reason; this is only acceptable when the buffer has
> not been allocated with an explicit modifier
[1]: https://lore.kernel.org/dri-devel/20210905122742.86029-1-daniels@collabora.com/
Signed-off-by: Simon Ser <contact@emersion.fr>
|
|
When the modifier is not supported by the compositor, and the
DMA-BUF contains multiple planes, xwl_pixmap->buffer is NULL.
Avoid crashing when calling wl_buffer_add_listener().
Signed-off-by: Simon Ser <contact@emersion.fr>
|
|
Some drivers (e.g. AMD GFX8-) don't support explicit format
modifiers. On these drivers, gbm_bo_create_with_modifiers()
will fail. This results in "Error getting buffer" in the logs
later on with all X11 windows staying invisible.
Fallback to the modifier-less API gbm_bo_create() in that case.
Signed-off-by: Simon Ser <contact@emersion.fr>
|
|
This reads from the format list, which is not yet filled in.
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
|
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
|
There are systems where softpipe is the default renderer,
e.g. when llvmpipe is not is not available. Using glamor
on such systems is never a good idea.
This mirrors what commit 0a9415cf793babed1f28c61f8047d51de04f1528
did for llvmpipe.
Closes: #1417
Signed-off-by: Ivan A. Melnikov <iv@altlinux.org>
|
|
The virgl driver exposes the name of the host renderer which might be llvmpipe.
In this case we still need glamor to be initialized.
Only check if the renderer starts with llvmpipe (which is what llvmpipe exposes).
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
|
|
Multiplanar GBM buffers can point to different objects from each plane.
Use the _for_plane API when possible to retrieve the correct prime FD
for each plane.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Simon Ser <contact@emersion.fr>
Tested-by: Guido Günther <agx@sigxcpu.org>
|
|
Check the fd for validity before giving a success return code.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Simon Ser <contact@emersion.fr>
Tested-by: Guido Günther <agx@sigxcpu.org>
|
|
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>
|