mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
freedreno/a6xx: Additional handle import logging
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:
parent
9d6bac7004
commit
532a896f80
2 changed files with 24 additions and 5 deletions
|
|
@ -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, ¶ms, &l))
|
||||
if (!fdl6_layout_image(&rsc->layout, screen->info, ¶ms, &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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue