dri: don't fetch X11 modifiers if we don't support them

If we supply modifiers to dri_create_image_with_modifiers() and
the driver doesn't support them, the function will fail. The X11
server always supports implicit modifiers so we can always fall
back to that.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: 4c06515892 ("dri: revert INVALID modifier special-casing")
(cherry picked from commit 655ac4fff6)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32730>
This commit is contained in:
Simon Ser
2024-12-07 13:10:04 +01:00
committed by Dylan Baker
parent 18f5161fe9
commit 0d97c42d7d
2 changed files with 4 additions and 2 deletions

View File

@@ -44,7 +44,7 @@
"description": "dri: don't fetch X11 modifiers if we don't support them",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "4c065158927d7bacc5eb1e4f2491b1db93f1dc12",
"notes": null

View File

@@ -36,9 +36,11 @@
#include "loader_dri_helper.h"
#include "loader_dri3_helper.h"
#include "pipe/p_screen.h"
#include "util/macros.h"
#include "util/simple_mtx.h"
#include "drm-uapi/drm_fourcc.h"
#include "dri_screen.h"
#include "dri_util.h"
/**
@@ -1401,7 +1403,7 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int fourcc,
if (draw->dri_screen_render_gpu == draw->dri_screen_display_gpu) {
#ifdef HAVE_X11_DRM
if (draw->multiplanes_available) {
if (draw->multiplanes_available && draw->dri_screen_render_gpu->base.screen->resource_create_with_modifiers) {
xcb_dri3_get_supported_modifiers_cookie_t mod_cookie;
xcb_dri3_get_supported_modifiers_reply_t *mod_reply;
xcb_generic_error_t *error = NULL;