1 /* SPDX-License-Identifier: Apache-2.0 OR MIT */ 2 /* 3 * Copyright (c) 2024 Rockchip Electronics Co., Ltd. 4 */ 5 6 #ifndef __VDPP_H__ 7 #define __VDPP_H__ 8 9 #include "vdpp_reg.h" 10 #include "vdpp_common.h" 11 12 /* vdpp log marco */ 13 #define VDPP_DBG_TRACE (0x00000001) 14 #define VDPP_DBG_INT (0x00000002) 15 #define VDPP_DBG_CHECK (0x00000004) 16 17 extern RK_U32 vdpp_debug; 18 19 #define VDPP_DBG(level, fmt, ...)\ 20 do {\ 21 if (level & vdpp_debug)\ 22 { mpp_log(fmt, ## __VA_ARGS__); }\ 23 } while (0) 24 25 struct vdpp_params { 26 RK_U32 src_yuv_swap; 27 RK_U32 dst_fmt; 28 RK_U32 dst_yuv_swap; 29 RK_U32 src_width; 30 RK_U32 src_height; 31 RK_U32 dst_width; 32 RK_U32 dst_height; 33 34 struct vdpp_addr src; // src frame 35 struct vdpp_addr dst; // dst frame 36 37 struct dmsr_params dmsr_params; 38 struct zme_params zme_params; 39 }; 40 41 struct vdpp_api_ctx { 42 RK_S32 fd; 43 struct vdpp_params params; 44 struct vdpp_reg reg; 45 struct dmsr_reg dmsr; 46 struct zme_reg zme; 47 }; 48 49 #ifdef __cplusplus 50 extern "C" { 51 #endif 52 53 MPP_RET vdpp_init(VdppCtx *ictx); 54 MPP_RET vdpp_deinit(VdppCtx ictx); 55 MPP_RET vdpp_control(VdppCtx ictx, VdppCmd cmd, void *iparam); 56 RK_S32 vdpp_check_cap(VdppCtx ictx); 57 58 #ifdef __cplusplus 59 } 60 #endif 61 62 #endif 63