1 /* SPDX-License-Identifier: Apache-2.0 OR MIT */ 2 /* 3 * Copyright (c) 2024 Rockchip Electronics Co., Ltd. 4 */ 5 6 #ifndef __HWPQ_DEBUG_H_ 7 #define __HWPQ_DEBUG_H_ 8 9 #include <stdio.h> 10 #include "mpp_log.h" 11 12 #define HWPQ_VDPP_TRACE (0x00000001) 13 #define HWPQ_VDPP_INFO (0x00000002) 14 #define HWPQ_VDPP_DUMP_IN (0x00000010) 15 #define HWPQ_VDPP_DUMP_OUT (0x00000020) 16 17 #define HWPQ_VDPP_DBG(flag, fmt, ...) _mpp_dbg(hwpq_vdpp_debug, flag, fmt, ## __VA_ARGS__) 18 #define HWPQ_VDPP_DBG_F(flag, fmt, ...) _mpp_dbg_f(hwpq_vdpp_debug, flag, fmt, ## __VA_ARGS__) 19 20 #define hwpq_vdpp_dbg(type, fmt, ...) \ 21 do {\ 22 if (hwpq_vdpp_debug & type)\ 23 mpp_log(fmt, ## __VA_ARGS__);\ 24 } while (0) 25 26 #define hwpq_vdpp_enter() \ 27 do {\ 28 if (hwpq_vdpp_debug & HWPQ_VDPP_TRACE)\ 29 mpp_log("line(%d), func(%s), enter", __LINE__, __FUNCTION__);\ 30 } while (0) 31 32 #define hwpq_vdpp_leave() \ 33 do {\ 34 if (hwpq_vdpp_debug & HWPQ_VDPP_TRACE)\ 35 mpp_log("line(%d), func(%s), leave", __LINE__, __FUNCTION__);\ 36 } while (0) 37 38 #define hwpq_vdpp_info(fmt, ...) \ 39 do {\ 40 if (hwpq_vdpp_debug & HWPQ_VDPP_INFO)\ 41 mpp_log(fmt, ## __VA_ARGS__);\ 42 } while (0) 43 44 extern RK_U32 hwpq_vdpp_debug; 45 46 #endif // __HWPQ_DEBUG_H_