freedreno/a6xx: Additional handle import logging
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Add additional error logging which can be enabled with
FD_MESA_DEBUG=layout to make it easier to debug handle
import failures.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37144>
This commit is contained in:
Rob Clark 2025-09-02 08:39:55 -07:00 committed by Marge Bot
parent 9d6bac7004
commit 532a896f80
2 changed files with 24 additions and 5 deletions

View file

@ -280,16 +280,26 @@ layout_resource_for_handle(struct fd_resource *rsc, struct winsys_handle *handle
.pitch = handle->stride,
};
if (ubwc && !can_do_ubwc(prsc))
if (ubwc && !can_do_ubwc(prsc)) {
if (FD_DBG(LAYOUT))
mesa_loge("cannot do ubwc for: %" PRSC_FMT, PRSC_ARGS(prsc));
return false;
}
struct fdl_image_params params = fd_image_params(prsc, ubwc, tile_mode);
if (!fdl6_layout_image(&rsc->layout, screen->info, &params, &l))
if (!fdl6_layout_image(&rsc->layout, screen->info, &params, &l)) {
if (FD_DBG(LAYOUT))
mesa_loge("layout failed for: %" PRSC_FMT, PRSC_ARGS(prsc));
return false;
}
if (rsc->layout.size > fd_bo_size(rsc->bo))
if (rsc->layout.size > fd_bo_size(rsc->bo)) {
if (FD_DBG(LAYOUT))
mesa_loge("invalid size (%" PRIu64 " vs %u) for: %" PRSC_FMT, rsc->layout.size,
fd_bo_size(rsc->bo), PRSC_ARGS(prsc));
return false;
}
return true;
}

View file

@ -1508,8 +1508,11 @@ fd_resource_from_handle(struct pipe_screen *pscreen,
rsc->b.is_shared = true;
struct fd_bo *bo = fd_screen_bo_from_handle(pscreen, handle);
if (!bo)
if (!bo) {
if (FD_DBG(LAYOUT))
mesa_loge("handle import failed for: %" PRSC_FMT, PRSC_ARGS(tmpl));
goto fail;
}
fd_resource_set_bo(rsc, bo);
@ -1518,11 +1521,17 @@ fd_resource_from_handle(struct pipe_screen *pscreen,
if (tmpl->target == PIPE_BUFFER) {
fdl_layout_buffer(&rsc->layout, tmpl->width0);
} else if (!screen->layout_resource_for_handle(rsc, handle)) {
if (FD_DBG(LAYOUT))
mesa_loge("layout failed for: %" PRSC_FMT, PRSC_ARGS(tmpl));
goto fail;
}
if (rsc->layout.pitch0 != handle->stride)
if (rsc->layout.pitch0 != handle->stride) {
if (FD_DBG(LAYOUT))
mesa_loge("invalid pitch (%u vs %u) for: %" PRSC_FMT, rsc->layout.pitch0,
handle->stride, PRSC_ARGS(tmpl));
goto fail;
}
if (screen->ro) {
rsc->scanout =