1 /* 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms of the GNU General Public License as published by the 6 * Free Software Foundation; either version 2 of the License, or (at your 7 * option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 * 17 */ 18 19 #ifndef __MKP_VO_DEV_H__ 20 #define __MKP_VO_DEV_H__ 21 22 #include "hi_common_vo.h" 23 #include "drv_vo.h" 24 25 #ifdef __cplusplus 26 #if __cplusplus 27 extern "C" { 28 #endif 29 #endif /* end of #ifdef __cplusplus */ 30 31 #define VO_DEV_TIME_REF_STEP 2 32 33 #define VO_DEV_MAX_FRAME_RATE 240 34 35 typedef struct { 36 hi_vo_intf_sync intf_sync; 37 hi_u32 width; 38 hi_u32 height; 39 } vo_intf_sync_info; 40 41 typedef struct { 42 hi_bool vo_enable; 43 hi_bool config; 44 hi_vo_pub_attr vou_attr; 45 46 hi_u32 max_width; 47 hi_u32 max_height; 48 49 hi_bool user_config; 50 hi_vo_user_sync_info vo_user_sync_info; 51 hi_vo_vga_param vga_param; 52 hi_vo_hdmi_param hdmi_param; 53 hi_vo_rgb_param rgb_param; 54 hi_vo_bt_param bt_param; 55 } vo_dev_info; 56 57 hi_void vo_init_dev_info(hi_void); 58 vo_dev_info *vo_get_dev_ctx(hi_vo_dev vo_dev); 59 hi_s32 vo_init_dev_ctx(hi_vo_dev dev); 60 61 hi_bool vo_is_dev_enabled(hi_vo_dev dev); 62 hi_void vo_get_dev_max_size(hi_vo_dev dev, hi_size *dev_size); 63 hi_void vo_get_intf_sync_size(hi_vo_intf_sync intf_sync, hi_u32 *width, hi_u32 *height); 64 hi_void vo_get_dev_max_size(hi_vo_dev dev, hi_size *dev_size); 65 66 hi_s32 vo_enable(hi_vo_dev dev); 67 hi_s32 vo_disable(hi_vo_dev dev); 68 69 hi_s32 vo_set_pub_attr(hi_vo_dev dev, const hi_vo_pub_attr *pub_attr); 70 hi_s32 vo_get_pub_attr(hi_vo_dev dev, hi_vo_pub_attr *pub_attr); 71 72 hi_s32 vo_check_dev_user_div(hi_vo_dev dev, hi_u32 dev_div, hi_u32 pre_div); 73 hi_s32 vo_set_user_sync_info(hi_vo_dev dev, const hi_vo_user_sync_info *sync_info); 74 75 hi_u32 vo_dev_get_bg_color(hi_vo_dev dev); 76 hi_void vo_dev_set_bg_color(hi_vo_dev dev, hi_u32 bg_color); 77 78 #ifdef __cplusplus 79 #if __cplusplus 80 } 81 #endif 82 #endif /* end of #ifdef __cplusplus */ 83 84 #endif /* end of #ifndef __MKP_VO_DEV_H__ */ 85