egl: fix error string for dri2_create_image_dma_buf()

Using dri2_create_image_khr_texture_error() here prints an error
like so:

    command: eglCreateImageKHR, error: EGL_BAD_ALLOC (0x3003), message: "dri2_create_image_khr_texture"

This is confusing, because dri2_create_image_khr_texture() is
unrelated to this error.

Instead, print a more accurate error manually.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19156>
This commit is contained in:
Simon Ser 2022-10-19 10:27:01 +02:00 committed by Marge Bot
parent e2d67765fa
commit 4c080cb8e5

View file

@ -2946,6 +2946,7 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext *ctx,
uint64_t modifier;
bool has_modifier = false;
unsigned error;
EGLint egl_error;
/**
* The spec says:
@ -3033,7 +3034,10 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext *ctx,
&error,
NULL);
}
dri2_create_image_khr_texture_error(error);
egl_error = egl_error_from_dri_image_error(error);
if (egl_error != EGL_SUCCESS)
_eglError(egl_error, "createImageFromDmaBufs failed");
if (!dri_image)
return EGL_NO_IMAGE_KHR;