From 2ed862c2fe0a017cda0f831ada9ca9fe22d22127 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Mon, 9 Dec 2024 10:00:31 +0100 Subject: [PATCH] radeonsi/vpe: Silence expected errors with unsupported output format YUV formats are currently unsupported for output, so we should not print any errors in case application uses YUV output format. There is a shader fallback that will be correctly used in this case. Don't print any vpelib errors unless AMDGPU_SIVPE_LOG_LEVEL is set. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12263 Acked-by: Ruijing Dong Part-of: --- src/gallium/drivers/radeonsi/si_vpe.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_vpe.c b/src/gallium/drivers/radeonsi/si_vpe.c index d77fd7bf286..131c615b62b 100755 --- a/src/gallium/drivers/radeonsi/si_vpe.c +++ b/src/gallium/drivers/radeonsi/si_vpe.c @@ -103,6 +103,11 @@ si_vpe_log(void* log_ctx, const char* fmt, ...) va_end(args); } +static void +si_vpe_log_silent(void* log_ctx, const char* fmt, ...) +{ +} + static void si_vpe_populate_debug_options(struct vpe_debug_options* debug) { @@ -110,9 +115,9 @@ si_vpe_populate_debug_options(struct vpe_debug_options* debug) } static void -si_vpe_populate_callback_modules(struct vpe_callback_funcs* funcs) +si_vpe_populate_callback_modules(struct vpe_callback_funcs* funcs, uint8_t log_level) { - funcs->log = si_vpe_log; + funcs->log = log_level ? si_vpe_log : si_vpe_log_silent; funcs->zalloc = si_vpe_zalloc; funcs->free = si_vpe_free; } @@ -197,7 +202,7 @@ si_vpe_populate_init_data(struct si_context *sctx, struct vpe_init_data* params, memset(¶ms->debug, 0, sizeof(struct vpe_debug_options)); si_vpe_populate_debug_options(¶ms->debug); - si_vpe_populate_callback_modules(¶ms->funcs); + si_vpe_populate_callback_modules(¶ms->funcs, log_level); SIVPE_DBG(log_level, "Get family: %d\n", sctx->family); SIVPE_DBG(log_level, "Get gfx_level: %d\n", sctx->gfx_level); @@ -914,7 +919,7 @@ si_vpe_processor_is_process_supported(struct pipe_video_codec *codec, result = vpe_check_support(vpe_handle, build_param, &bufs_required); if (VPE_STATUS_OK != result) { - SIVPE_ERR("Check support failed with result: %d\n", result); + SIVPE_WARN(vpeproc->log_level, "Check support failed with result: %d\n", result); return 1; }