egl/wayland: ensure wl_drm is available before use

Avoid crashing if wl_drm is unavailable. Instead, gracefully error
out.

Signed-off-by: Simon Ser <contact@emersion.fr>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fixes: c60fea8c22 ("Revert "egl/wayland: deprecate drm_handle_format() and drm_handle_capabilities()"")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26346>
(cherry picked from commit 35143febba)
This commit is contained in:
Simon Ser 2023-11-23 20:17:07 +01:00 committed by Eric Engestrom
parent cced7e7b7a
commit dba05ca558
2 changed files with 2 additions and 2 deletions

View file

@ -4344,7 +4344,7 @@
"description": "egl/wayland: ensure wl_drm is available before use",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "c60fea8c228ae3f32e20d6b65c473d9f04871d20",
"notes": null

View file

@ -1487,7 +1487,7 @@ create_wl_buffer(struct dri2_egl_display *dri2_dpy,
ret = zwp_linux_buffer_params_v1_create_immed(params, width, height,
fourcc, 0);
zwp_linux_buffer_params_v1_destroy(params);
} else {
} else if (dri2_dpy->wl_drm) {
struct wl_drm *wl_drm =
dri2_surf ? dri2_surf->wl_drm_wrapper : dri2_dpy->wl_drm;
int fd = -1, stride;