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 <Jesse.Agate@amd.com> Reviewed-by: Roy Chan <Roy.Chan@amd.com> Acked-by: Chuanyu Tseng <Chuanyu.Tseng@amd.com> Signed-off-by: Navid Assadian <navid.assadian@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36433>
This commit is contained in:
committed by
Marge Bot
parent
5b8b5c4c49
commit
b529d38ae9
@@ -29,6 +29,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h> // 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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user