summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-02-27 14:43:49 +0100
committerOlivier Fourdan <fourdan@gmail.com>2023-03-03 08:39:54 +0000
commitc6f2598a4e62ea6c0d5244faf1488b20985df908 (patch)
tree259a69aeae8d605f03e3e2776e5fa0cd595a0c96
parent76a329e55c34e2d60a0b1d92bf61bbf3baf5dd41 (diff)
downloadxserver-c6f2598a4e62ea6c0d5244faf1488b20985df908.tar.gz
xwayland: don't fall back to wl_drm with explicit modifier
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>
-rw-r--r--hw/xwayland/xwayland-glamor-gbm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index 2d42bbba3..dcad1df04 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -433,7 +433,7 @@ xwl_glamor_gbm_get_wl_buffer_for_pixmap(PixmapPtr pixmap)
zwp_linux_buffer_params_v1_create_immed(params, width, height,
format, 0);
zwp_linux_buffer_params_v1_destroy(params);
- } else if (num_planes == 1) {
+ } else if (num_planes == 1 && modifier == DRM_FORMAT_MOD_INVALID) {
xwl_pixmap->buffer =
wl_drm_create_prime_buffer(xwl_gbm->drm, prime_fds[0], width, height,
format,