mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
frontends/dri: add error logs to dri2_create_image_from_fd
These silent failures are hard to track otherwise. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30159>
This commit is contained in:
parent
252485b0e2
commit
a04dc1a451
1 changed files with 12 additions and 2 deletions
|
|
@ -39,6 +39,7 @@
|
|||
#include "util/u_debug.h"
|
||||
#include "util/libsync.h"
|
||||
#include "util/os_file.h"
|
||||
#include "util/log.h"
|
||||
#include "frontend/drm_driver.h"
|
||||
#include "state_tracker/st_format.h"
|
||||
#include "state_tracker/st_cb_texture.h"
|
||||
|
|
@ -1193,13 +1194,22 @@ dri2_create_image_from_fd(__DRIscreen *_screen,
|
|||
int i;
|
||||
const int expected_num_fds = dri2_get_modifier_num_planes(_screen, modifier, fourcc);
|
||||
|
||||
if (!map || expected_num_fds == 0) {
|
||||
if (!map) {
|
||||
err = __DRI_IMAGE_ERROR_BAD_MATCH;
|
||||
mesa_loge("dri: cannot create image from fds (fourcc 0x%08x -> dri2 failed)\n",
|
||||
fourcc);
|
||||
goto exit;
|
||||
}
|
||||
if (expected_num_fds == 0) {
|
||||
err = __DRI_IMAGE_ERROR_BAD_MATCH;
|
||||
mesa_loge("dri: cannot create image from fds (unsupported modifier 0x%" PRIx64 ")\n",
|
||||
modifier);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (num_fds != expected_num_fds) {
|
||||
err = __DRI_IMAGE_ERROR_BAD_MATCH;
|
||||
mesa_loge("dri: cannot create image from fds (expected %d fds but got %d)\n",
|
||||
expected_num_fds, num_fds);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue