From b529d38ae94fd90c1488fe012e8fba0c374c8c16 Mon Sep 17 00:00:00 2001 From: "Assadian, Navid" Date: Thu, 12 Jun 2025 10:01:19 -0400 Subject: [PATCH] amd/vpelib: Exit when VPE not support in debug When the debug flag is set to assert when vpe is not supported, instead of assert it is preferable to exit so the CI aborts the process instead of waiting on the assert message. [WHY] In debug mode for CI, when assert the process doesn't abort and the CI terminates on time out. [HOW] Using exit instead of assert Reviewed-by: Jesse Agate Reviewed-by: Roy Chan Acked-by: Chuanyu Tseng Signed-off-by: Navid Assadian Part-of: --- src/amd/vpelib/src/core/inc/vpe_assert.h | 3 +++ src/amd/vpelib/src/core/vpelib.c | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/amd/vpelib/src/core/inc/vpe_assert.h b/src/amd/vpelib/src/core/inc/vpe_assert.h index df67d3ce6bd..67e29e98238 100644 --- a/src/amd/vpelib/src/core/inc/vpe_assert.h +++ b/src/amd/vpelib/src/core/inc/vpe_assert.h @@ -29,6 +29,7 @@ extern "C" { #endif #include +#include // for exit() #if defined(_WIN32) @@ -43,8 +44,10 @@ extern "C" { #ifdef _DEBUG #define VPE_ASSERT(_expr) assert(_expr) +#define VPE_EXIT(_expr) exit(_expr) #else #define VPE_ASSERT(_expr) ((void)0) +#define VPE_EXIT(_expr) ((void)0) #endif #ifdef __cplusplus diff --git a/src/amd/vpelib/src/core/vpelib.c b/src/amd/vpelib/src/core/vpelib.c index 22de4f89c0a..5532d415050 100644 --- a/src/amd/vpelib/src/core/vpelib.c +++ b/src/amd/vpelib/src/core/vpelib.c @@ -663,8 +663,10 @@ enum vpe_status vpe_check_support( status = vpe_validate_geometric_scaling_support(param); } - if (vpe_priv->init.debug.assert_when_not_support) - VPE_ASSERT(status == VPE_STATUS_OK); + if (vpe_priv->init.debug.assert_when_not_support && status != VPE_STATUS_OK) { + vpe_log("vpe_check_support failed with status %d\n", (int)status); + VPE_EXIT(1); + } vpe_event(VPE_EVENT_CHECK_SUPPORT, vpe_priv->num_streams, param->target_rect.width, param->target_rect.height, status); @@ -900,8 +902,10 @@ enum vpe_status vpe_build_commands( vpe_priv->ops_support = false; - if (vpe_priv->init.debug.assert_when_not_support) - VPE_ASSERT(status == VPE_STATUS_OK); + if (vpe_priv->init.debug.assert_when_not_support && status != VPE_STATUS_OK) { + vpe_log("vpe_check_support failed with status %d\n", (int)status); + VPE_EXIT(1); + } return status; }