1 /* 2 * Copyright 2015 Rockchip Electronics Co. LTD 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef __HAL_VP8E_DEBUG_H__ 18 #define __HAL_VP8E_DEBUG_H__ 19 20 #include "mpp_debug.h" 21 22 #define VP8E_DBG_HAL_FUNCTION (0x00000001) 23 #define VP8E_DBG_HAL_REG (0x00000002) 24 #define VP8E_DBG_HAL_DUMP_REG (0x00000004) 25 #define VP8E_DBG_HAL_IRQ (0x00000008) 26 #define VP8E_DBG_HAL_DUMP_IVF (0x00000010) 27 28 #define VP8E_DBG(flag, fmt, ...) _mpp_dbg(vp8e_hal_debug, flag, fmt, ## __VA_ARGS__) 29 #define VP8E_DBG_F(flag, fmt, ...) _mpp_dbg_f(vp8e_hal_debug, flag, fmt, ## __VA_ARGS__) 30 31 #define vp8e_hal_err(fmt, ...) \ 32 do {\ 33 mpp_err_f(fmt, ## __VA_ARGS__);\ 34 } while (0) 35 36 #define vp8e_hal_dbg(type, fmt, ...) \ 37 do {\ 38 if (vp8e_hal_debug & type)\ 39 mpp_log(fmt, ## __VA_ARGS__);\ 40 } while (0) 41 42 #define vp8e_hal_enter() \ 43 do {\ 44 if (vp8e_hal_debug & VP8E_DBG_HAL_FUNCTION)\ 45 mpp_log("line(%d), func(%s), enter", __LINE__, __FUNCTION__);\ 46 } while (0) 47 48 #define vp8e_hal_leave() \ 49 do {\ 50 if (vp8e_hal_debug & VP8E_DBG_HAL_FUNCTION)\ 51 mpp_log("line(%d), func(%s), leave", __LINE__, __FUNCTION__);\ 52 } while (0) 53 54 extern RK_U32 vp8e_hal_debug; 55 56 #endif /*__HAL_VP8E_DEBUG_H__*/ 57