From 4d4619a19388d3f7e5a1cb08ac4cd6e9aa8121e6 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 25 Jul 2018 15:52:01 +0200 Subject: [PATCH] dri3: Do not get supported modifiers on pixmaps get_supported_modifiers() expects a window as drawable, passing a pixmap will fail as the Xserver will fail to match the id to a window. That leads to dri3_alloc_render_buffer() to return NULL and breaks rendering when using GLX_DOUBLEBUFFER. Check if dealing with pixmap in dri3_alloc_render_buffer() in which case avoid using get_supported_modifiers() and fallback to the good old pixmap_from_buffer() method as before. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107117 Fixes: 069fdd5 ("egl/x11: Support DRI3 v1.1") Signed-off-by: Olivier Fourdan --- src/loader/loader_dri3_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c index f0ff2f07bd..83b7c66a44 100644 --- a/src/loader/loader_dri3_helper.c +++ b/src/loader/loader_dri3_helper.c @@ -1139,6 +1139,7 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int format, if (!draw->is_different_gpu) { #ifdef HAVE_DRI3_MODIFIERS if (draw->multiplanes_available && + !draw->is_pixmap && draw->ext->image->base.version >= 15 && draw->ext->image->queryDmaBufModifiers && draw->ext->image->createImageWithModifiers) { @@ -1278,6 +1279,7 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int format, pixmap = xcb_generate_id(draw->conn); #ifdef HAVE_DRI3_MODIFIERS if (draw->multiplanes_available && + !draw->is_pixmap && buffer->modifier != DRM_FORMAT_MOD_INVALID) { xcb_dri3_pixmap_from_buffers(draw->conn, pixmap, -- 2.17.1