1 /* 2 * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your 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, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 */ 18 #ifndef __DRV_HDMI_DFM_H__ 19 #define __DRV_HDMI_DFM_H__ 20 21 #include "hi_type.h" 22 23 #define AUDIO_SAMPLE_PACKET 0x02 24 #define ONE_BIT_AUDIO_SAMPLE_PACKET 0x07 25 #define DTS_AUDIO_PACKET 0x08 26 #define HBR_AUDIO_PACKET 0x09 27 #define AUDIO_3D_SAMPLE_PACKET 0x0B 28 #define ONE_BIT_AUDIO_3D_SAMPLE_PACKET 0x0C 29 #define MULTI_STREAM_AUDIO_SAMPLE_PACKET 0x0E 30 #define ONE_BIT_MULTI_STREAM_AUDIO_SAMPLE_PACKET 0x0F 31 #define AUDIO_CHANNEL_ALLOC_TYPE1 1 32 #define AUDIO_CHANNEL_ALLOC_TYPE2 2 33 #define AUDIO_CHANNEL_ALLOC_TYPE3 3 34 35 typedef struct { 36 hi_bool audio_support; 37 hi_bool video_support; 38 hi_bool uncompress_support; 39 hi_bool is_extra_mode; 40 hi_bool canbe_trans; 41 hi_s32 htotal; 42 hi_s32 vtotal; 43 hi_s32 bpp; 44 hi_s32 c_frl_sb; 45 hi_s32 overhead_sb; 46 hi_s32 overhead_rs; 47 hi_s32 overhead_map; 48 hi_s32 overhead_min; 49 hi_s32 overhead_m; 50 hi_s32 overhead_max; 51 hi_s32 min_time_line; 52 hi_s32 max_time_line; 53 hi_s32 min_frl_chars_per_line; 54 hi_s32 max_frl_chars_per_line; 55 hi_s32 audio_ap; 56 hi_s32 audio_rap; 57 hi_s32 avg_audio_packets; 58 hi_s32 audio_packets; 59 hi_s32 blank_audio_min; 60 hi_s32 c_frl_free; 61 hi_s32 c_frl_rc_margin; 62 hi_s32 c_frl_rc_savings; 63 hi_s32 active_bytes_per_line; 64 hi_s32 active_tb_per_line; 65 hi_s32 blank_tb_per_line; 66 hi_s32 active_time_ref; 67 hi_s32 blank_time_ref; 68 hi_s32 active_time_min; 69 hi_s32 blank_time_min; 70 hi_s32 t_borrow; 71 hi_s32 tb_borrow; 72 hi_s32 c_frl_actual_payload; 73 hi_s32 utilization; 74 hi_s32 margin; 75 hi_s64 avg_tb_rate; 76 hi_s64 pixel_clk; 77 hi_s64 max_pixel_clk; 78 hi_s64 min_pixel_clk; 79 hi_s64 max_bit_rate; 80 hi_s64 min_bit_rate; 81 hi_s64 max_frl_char_rate; 82 hi_s64 min_frl_char_rate; 83 } dfm_info; 84 85 typedef struct { 86 hi_s32 hactive; 87 hi_s32 vactive; 88 hi_s32 hblank; 89 hi_s32 vblank; 90 hi_s32 hsync; 91 hi_s32 hback; 92 hi_s32 hfront; 93 hi_s32 vsync; 94 hi_s32 vback; 95 hi_s32 vfront; 96 hi_s32 v_freq; 97 hi_s32 color_depth; 98 hi_s32 pixel_format; /* 1:420, 2:422, 3:RGB444 */ 99 hi_s32 lane_num; 100 hi_s32 bit_rate; 101 hi_s32 audio_rate; 102 hi_s32 packet_type; 103 hi_s32 layout; 104 hi_s32 acat; 105 } dfm_in; 106 107 hi_bool drv_hdmi_dfm_format_support(dfm_in *dfm); 108 109 #endif /* __DRV_HDMI_DFM_H__ */ 110 111