You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1105 lines
63 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
* Copyright (c) Hisilicon Technologies Co., Ltd. 2009-2020. All rights reserved.
* Description: Define the infomation about hdmi module.
* Author: Hisilicon
* Create: 2009-08-28
*/
#ifndef UAPI_HDMITX_H
#define UAPI_HDMITX_H
#include "uapi_cec.h"
#include "uapi_video.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
#define UAPI_HDMITX_VENDOR_NAME_LEN 4
/*
* 3D video capibility bit definations
* CNcomment: 3D 能力位定义
*/
#define UAPI_HDMITX_3D_BZ_NONE 0
#define UAPI_HDMITX_3D_BZ_FRAME_PACKING (1 << 1)
#define UAPI_HDMITX_3D_BZ_FIELD_ALTERNATIVE (1 << 2)
#define UAPI_HDMITX_3D_BZ_LINE_ALTERNATIVE (1 << 3)
#define UAPI_HDMITX_3D_BZ_SIDE_BY_SIDE_FULL (1 << 4)
#define UAPI_HDMITX_3D_BZ_L_DEPTH (1 << 5)
#define UAPI_HDMITX_3D_BZ_L_DEPTH_GFX_GFX_DEPTH (1 << 6)
#define UAPI_HDMITX_3D_BZ_TOP_AND_BOTTOM (1 << 7)
#define UAPI_HDMITX_3D_BZ_SIDE_BY_SIDE_HALF (1 << 8)
/*
* UAPI_HDMITX_TIMING_FLAG flag definations
* CNcomment: 详细时序的标志位定义
*/
#define UAPI_HDMITX_TIMING_FLAG_NATIVE (1 << 0)
/*
* if bit is 1, the timing's vertical frequency is adjusted by a factor of 1000/1001
* CNcomment: 当bit为1时则时序的垂直频率调整因子为1000/1001。
*/
#define UAPI_HDMITX_TIMING_FLAG_ALTERNATE_RATE (1 << 1)
/*
* Short Audio Descriptors max count, see CTA-861-G 7.5.2 Audio Data Block
* CNcomment: 简式音频描述符最大个数.见 CTA-861-G 7.5.2 Audio Data Block
*/
#define UAPI_HDMITX_MAX_AUDIO_CNT (0xe + 0x9)
/*
* Color format/depth(@u32ColorCap) flag definations
* CNcomment: 颜色格式/位宽能力标志位定义
*/
#define UAPI_HDMITX_COLOR_RGB_24 (1 << 0)
#define UAPI_HDMITX_COLOR_RGB_30 (1 << 1)
#define UAPI_HDMITX_COLOR_RGB_36 (1 << 2)
#define UAPI_HDMITX_COLOR_RGB_48 (1 << 3)
#define UAPI_HDMITX_COLOR_Y444_24 (1 << 4)
#define UAPI_HDMITX_COLOR_Y444_30 (1 << 5)
#define UAPI_HDMITX_COLOR_Y444_36 (1 << 6)
#define UAPI_HDMITX_COLOR_Y444_48 (1 << 7)
#define UAPI_HDMITX_COLOR_Y420_24 (1 << 8)
#define UAPI_HDMITX_COLOR_Y420_30 (1 << 9)
#define UAPI_HDMITX_COLOR_Y420_36 (1 << 10)
#define UAPI_HDMITX_COLOR_Y420_48 (1 << 11)
#define UAPI_HDMITX_COLOR_Y422 (1 << 12)
#define UAPI_HDMITX_COLOR_RGB_MASK (0xf << 0)
#define UAPI_HDMITX_COLOR_Y444_MASK (0xf << 4)
#define UAPI_HDMITX_COLOR_Y420_MASK (0xf << 8)
#define UAPI_HDMITX_COLOR_Y422_MASK (1 << 12)
/*
* HDCP re-authen defalut time, see uapi_hdmitx_hdcp_set_auth_times
* CNcomment: HDCP重认证默认时间
*/
#define UAPI_HDMITX_HDCP_REAUTH_DEFAULT 0xffffffff
/*
* Defines HDMITX interface ID
* CNcomment: 定义HDMITX 接口ID
*/
typedef enum {
UAPI_HDMITX_ID_0 = 0, /* HDMITX interface 0 */ /* CNcomment: HDMITX接口0 */
UAPI_HDMITX_ID_1 = 1, /* HDMITX interface 1 */ /* CNcomment: HDMITX接口1 */
UAPI_HDMITX_ID_MAX
} uapi_hdmitx_id;
/*
* Defines HDMITX event type
* CNcomment: 定义HDMITX事件类型
*/
typedef enum {
UAPI_HDMITX_EVENT_HOTPLUG_IN, /* HDMITX cable plug in */ /* CNcomment: HDMITX线缆插入 */
UAPI_HDMITX_EVENT_HOTPLUG_OUT, /* HDMITX cable plug out */ /* CNcomment: HDMITX线缆拔出 */
UAPI_HDMITX_EVENT_HDCP_CAP_CHANGE, /* HDCP capability change */ /* CNcomment: HDCP能力改变 */
UAPI_HDMITX_EVENT_HDCP_FAIL, /* HDCP authentication fail */ /* CNcomment: HDCP认证失败 */
UAPI_HDMITX_EVENT_HDCP_SUCCESS, /* HDCP authentication success */ /* CNcomment: HDCP认证成功 */
UAPI_HDMITX_EVENT_RSEN_CONNECT, /* HDMITX TMDS link connect */ /* CNcomment: TMDS链接成功 */
UAPI_HDMITX_EVENT_RSEN_DISCONNECT, /* HDMITX TMDS link is disconnect */ /* CNcomment: TMDS断开链接 */
UAPI_HDMITX_EVENT_LINK_TRAIN_FAIL, /* HDMITX FRL link training fail */ /* CNcomment: HDMITX固定码率链路训练失败 */
UAPI_HDMITX_EVENT_HDCP_KEY_LOST, /* HDMITX HDCP AUTH LOST HDCP1.4 KEY */ /* CNcomment: HDCP1.4 key 丢失 */
UAPI_HDMITX_EVENT_MAX
} uapi_hdmitx_event_type;
/*
* Defines event callback function interface
* CNcomment: 定义事件回调函数
*/
typedef td_void (*uapi_hdmitx_callback_ptr)(uapi_hdmitx_id id, uapi_hdmitx_event_type event,
td_void *private_data);
/*
* Defines HDMITX Callback Struct
* CNcomment: 定义HDMITX回调结构体类型
*/
typedef struct {
uapi_hdmitx_callback_ptr event_callback_func; /* callback function pointer */ /* CNcomment: 回调函数指针 */
td_void *private_data; /* callback funtion param */ /* CNcomment: 回调函数参数 */
} uapi_hdmitx_callback;
/*
* HDMITX hot plug status
* CNcomment: HDMITX 线缆拔插状态
*/
typedef enum {
UAPI_HDMITX_HOTPLUG_DETECTING, /* Hotplug is detecting */ /* CNcomment: 拔插状态检测中 */
UAPI_HDMITX_HOTPLUG_IN, /* Plug in */ /* CNcomment: 插入 */
UAPI_HDMITX_HOTPLUG_OUT, /* Plug out */ /* CNcomment: 拔出 */
UAPI_HDMITX_HOTPLUG_DET_FAIL, /* Hot plug detection failure */ /* CNcomment: 线缆拔插检测失效 */
} uapi_hdmitx_hotplug_status;
/*
* HDMITX TMDS link rsen status
* CNcomment: HDMITX TMDS链路的rsen状态
*/
typedef enum {
UAPI_HDMITX_RSEN_DISCONNECT, /* Rsen disconnect */ /* CNcomment: TMDS RSEN断开连接 */
UAPI_HDMITX_RSEN_CONNECT, /* Rsen connect */ /* CNcomment: TMDS RSEN链接成功 */
UAPI_HDMITX_RSEN_DET_FAIL, /* Rsen detection failure */ /* CNcomment: TMDS RSEN检测失效 */
} uapi_hdmitx_rsen_status;
/*
* HDMITX status
* CNcomment: HDMITX 状态
*/
typedef struct {
uapi_hdmitx_hotplug_status hotplug; /* HDMITX hot plug status */ /* CNcomment: hot plug状态 */
uapi_hdmitx_rsen_status rsen; /* HDMITX TMDS link rsen status */ /* CNcomment: TMDS链路的rsen状态 */
td_bool output_enable; /* HDMITX signal output enable status */ /* CNcomment: 信号输出使能状态 */
} uapi_hdmitx_status;
/*
* Sink colorimety capability infomation struct. see CTA-861-G
* CNcomment: Sink色域能力信息结构体, 请参考CTA-861-G
*/
typedef struct {
td_bool xvycc601; /* support xvYCC601, Standard Definition Colorimetry based on IEC 61966-2-4 [5 ]
* CNcomment: 支持xvYCC601基于IEC 61966-2-4 [5]的标准定义色域 */
td_bool xvycc709; /* support xvYCC709, High Definition Colorimetry based on IEC 61966-2-4 [5 ]
* CNcomment: 支持xvYCC709基于IEC 61966-2-4 [5]的高清色域 */
td_bool sycc601; /* Colorimetry based on IEC 61966-2-1/Amendment 1 [34]
* CNcomment: 色域设置基于 IEC 61966-2-1/Amendment 1 [34] */
td_bool adobe_ycc601; /* Colorimetry based on IEC 61966-2-5 [32], Annex A
* CNcomment: 色域设置基于 IEC 61966-2-5 [32], Annex A */
td_bool adobe_rgb; /* Colorimetry based on IEC 61966-2-5 [32]
* CNcomment: 色域设置基于 IEC 61966-2-5 [32] */
td_bool bt2020_c_ycc; /* Colorimetry based on ITU-R BT.2020 [39] Y'cC'bcC'rc
* CNcomment: 色域设置基于 ITU-R BT.2020 [39] Y'cC'bcC'rc */
td_bool bt2020_ycc; /* Colorimetry based on ITU-R BT.2020 [39] Y'C'BC'R
* CNcomment: 色域设置基于 ITU-R BT.2020 [39] Y'C'BC'R */
td_bool bt2020_rgb; /* Colorimetry based on ITU-R BT.2020 [39] R'G'B'
* CNcomment: 色域设置基于 ITU-R BT.2020 [39] R'G'B' */
td_bool dci_p3; /* Colorimetry based on DCI-P3 [51][52] */ /* CNcomment: 色域设置基于 DCI-P3 [51][52] */
} uapi_hdmitx_colorimetry;
/*
* Sink manufacture infomation struct
* CNcomment: Sink 制造信息结构体
*/
typedef struct {
td_u8 mfrs_name[UAPI_HDMITX_VENDOR_NAME_LEN]; /* manufacture name */ /* CNcomment: 制造名字 */
td_u32 product_code; /* product code */ /* CNcomment: 产品代码 */
td_u32 serial_number; /* serial numeber of manufacture */ /* CNcomment: 制造的序列号 */
td_u32 week; /* the week of manufacture */ /* CNcomment: 生产周 */
td_u32 year; /* the year of manufacture */ /* CNcomment: 制造的年限 */
} uapi_hdmitx_manufacture_info;
/*
* Define sdetail timing information
* CNcomment: 详细时序信息定义
*/
typedef struct {
td_u32 pixel_clock; /* pixel clock */ /* CNcomment: 像素时钟 */
td_bool progressive; /* if ture, the timing is a progressive format; or it is a interlaced format */
/* CNcomment: 如果true则时序为逐行输出格式或者为隔行输出格式 */
td_u32 field_rate; /* field rate */ /* CNcomment: 场速率 */
td_u32 h_active; /* horizontal active */ /* CNcomment: 水平活动区域 */
td_u32 h_total; /* horizontal total */ /* CNcomment: 水平计数 */
td_u32 h_blank; /* horizontal blank */ /* CNcomment: 水平空白区域 */
td_u32 h_front; /* horizontal front */ /* CNcomment: 水平前消隐 */
td_u32 h_sync; /* horizontal sync pulse */ /* CNcomment: 水平同步脉冲 */
td_u32 h_back; /* horizontal back */ /* CNcomment: 水平后消隐 */
td_bool h_pol; /* horizontal polarity, true for positive, false for negative */
/* CNcomment: 水平极性,正为真,负为假 */
td_u32 v_active; /* vertical active */ /* CNcomment: 垂直活动区域 */
td_u32 v_total; /* vertical total */ /* CNcomment: 垂直计数 */
td_u32 v_blank; /* vertical blank */ /* CNcomment: 垂直空白区域 */
td_u32 v_front; /* vertical front */ /* CNcomment: 垂直前消隐 */
td_u32 v_sync; /* vertical sync pulse */ /* CNcomment: 垂直同步脉冲 */
td_u32 v_back; /* vertical back */ /* CNcomment: 垂直后消隐 */
td_bool v_pol; /* vertical polarity, true for positive, false for negative */
/* CNcomment: 垂直极性,正为真,负为假 */
uapi_video_aspect_ratio pic_asp_ratio; /* see picture aspect ratio definations */
/* CNcomment: 见画面纵横比定义 */
td_u32 flag; /* see UAPI_HDMITX_TIMING_FLAG_XXX definations */
/* CNcomment: 见相关UAPI_HDMITX_TIMING_FLAG_XXX 宏定义 */
td_u32 mode_3d; /* see 3D video capibility bit definations, UAPI_HDMITX_3D_BZ_XXX */
/* CNcomment: 见3D视频能力位定义UAPI_HDMITX_3D_BZ_XXX */
} uapi_hdmitx_detail_timing;
/*
* available mode information
* CNcomment: 有效制式模式信息
*/
typedef struct {
td_u32 vic; /* Video ID Code */ /* CNcomment: 视频ID编码 */
uapi_hdmitx_detail_timing detail_timing; /* see detail timing information */ /* CNcomment: 详细时序信息定义 */
td_u32 color_cap; /* see Color format/depth(@u32ColorCap) flag definations */
/* CNcomment: 见颜色格式/深度(@u32ColorCap标志定义 */
} uapi_hdmitx_avail_mode;
/*
* available capability information
* CNcomment: 有效能力信息
*/
typedef struct {
uapi_hdmitx_avail_mode native_mode; /* the native mode */ /* CNcomment: 最佳模式 */
uapi_hdmitx_avail_mode max_mode; /* the max resolution & field rate mode */
/* CNcomment: 最大分辨率&场速率模式 */
td_u32 mode_cnt; /* avail modes count */ /* CNcomment: 有效模式计数 */
td_u32 max_tmds_clock; /* max tmds clock */ /* CNcomment: 最大的TMDS时钟 */
td_bool dvi_only; /* If true, this sink only supports DVI mode else support HDMITX mode and DVI mode */
/* CNcomment: 如果为真则对端只支持DVI模式否则支持HDMITX模式和DVI模式 */
} uapi_hdmitx_avail_cap;
/*
* EDID latency capability, see <hdmi1.4b> page154
* CNcomment: Sink 音视频延时能力结构体, 请参考hdmi1.4b 的154页
*/
typedef struct {
td_bool present; /* latency info is valid. */ /* CNcomment: 时延信息有效. */
td_u32 p_video; /* video latency for progressive video formats.in milliseconds */
/* CNcomment: 逐行视频格式的视频延迟,以毫秒为单位 */
td_u32 p_audio; /* audio latency for progressive video formats.in milliseconds */
/* CNcomment: 逐行视频格式的音频延迟,以毫秒为单位 */
td_u32 i_video; /* video latency for interlaced video formats.in milliseconds */
/* CNcomment: 隔行扫描视频格式的视频延迟。以毫秒为单位 */
td_u32 i_audio; /* audio latency for interlaced video formats.in milliseconds */
/* CNcomment: 隔行扫描视频格式的音频延迟。以毫秒为单位 */
} uapi_hdmitx_latency;
/*
* EDID max display parameters struct
* CNcomment: Sink 最大显示尺寸结构体
*/
typedef struct {
td_u8 max_image_width; /* the disp image max width (0~255)cm */ /* CNcomment: 色散图像最大宽度(0~255)cm */
td_u8 max_image_height; /* the disp image max height (0~255)cm */ /* CNcomment: 色散图像最大高度(0~255)cm */
} uapi_hdmitx_disp_para;
/*
* Defines eotf capability struct
* CNcomment: 定义eotf能力结构体
*/
typedef struct {
td_bool traditional_sdr; /* Traditional gamma - SDR Luminance Range */ /* CNcomment: 传统伽玛-SDR亮度范围 */
td_bool traditional_hdr; /* Traditional gamma - HDR Luminance Range */ /* CNcomment: 传统伽玛-HDR亮度范围 */
td_bool hdr10; /* HDR10(SMPTE ST 2084) */ /* CNcomment:HDMT HDR的HDR10模式 */
td_bool hlg; /* Hybrid Log-Gamma */ /* CNcomment: HDMT HDR的HLG模式(混合对数伽玛) */
} uapi_hdmitx_eotf;
/*
* Sink HDR dynamic metadata type
* CNcomment: Sink 动态元数据能力结构体
*/
typedef struct {
td_bool d_type1_support; /* type1 dynamic metadata support */ /* CNcomment: type1动态元数据支持 */
td_u32 d_type1_version; /* type1 dynamic metadata version */ /* CNcomment: type1动态元数据版本 */
td_bool d_type2_support; /* type2 dynamic metadata support */ /* CNcomment: type2动态元数据支持 */
td_u32 d_type2_version; /* type2 dynamic metadata version */ /* CNcomment: type2动态元数据版本 */
td_bool d_type3_support; /* type3 dynamic metadata support */ /* CNcomment: type3动态元数据支持 */
td_bool d_type4_support; /* type4 dynamic metadata support */ /* CNcomment: type4动态元数据支持 */
td_u32 d_type4_version; /* type_4_hdr_metadata_version */ /* CNcomment: type4动态元数据版本 */
} uapi_hdmitx_dynamic_metadata;
/*
* Sink HDR static metadata type
* CNcomment: Sink 静态元数据能力结构体
*/
typedef struct {
td_bool stype1; /* Static Metadata Type 1 support */ /* CNcomment: 静态元数据Type1支持 */
td_u8 max_lum_cv; /* Desired Content Max Luminance Data. Real value(in 1cd/m^2) = 50.2^(CV/32) */
/* CNcomment: 期望的内容最大亮度数据 */
td_u8 aver_lum_cv; /* Desired Content Max Frame-average Luminance. Real value(in 1cd/m^2) = 50.2^(CV/32) */
/* CNcomment: 所需内容最大帧平均亮度 */
td_u8 min_lum_cv; /* Desired Content Min Luminance Data.
* Real value(in 1cd/m^2) = MaxLuminance_CV * (MinLuminance_CV/255)^2 / 100 */
/* CNcomment: 所需内容最小亮度数据。 */
} uapi_hdmitx_static_metadata;
/*
* Sink HDR capability struct
* CNcomment: Sink HDR能力结构体
*/
typedef struct {
uapi_hdmitx_eotf eotf;
uapi_hdmitx_static_metadata static_metadata; /* HDR Static Metadata Type */ /* CNcomment: HDR静态元数据类型 */
uapi_hdmitx_dynamic_metadata dynamic_metadata; /* HDR Dynamic Metadata Type */ /* CNcomment: HDR动态元数据类型 */
} uapi_hdmitx_hdr_info;
/*
* EDID dolby vision capability ,for version 0
* CNcomment: Sink dolby vision能力结构体(版本0)
*/
typedef struct {
td_bool ycbcr422_12bit; /* support(true) or not support(false) a YCbCr422-12Bit dolby singal */
/* CNcomment: 支持(true)或不支持(false)YCbCr422-12bit杜比信号 */
td_bool cap_2160p60; /* capable of processing a max timming 3840X2160p60(true)/3840X2160p30(false) */
/* CNcomment: 能够处理最大时序3840X2160p60/3840X2160p30 */
td_bool global_dimming; /* support(true) or not support(false) global dimming. */
/* CNcomment: 支持(true)或不支持(false)全局调光功能 */
td_u16 white_x; /* white point chromaticity coordinate x, bit[11:0] valid. bit[11:0] valid.
* Real value = SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 白点色度坐标xbit[11:0]有效。bit[11:0]有效。 */
td_u16 white_y; /* white point chromaticity coordinate y, bit[11:0] valid. bit[11:0] valid.
* Real value = SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 白点色度坐标ybit[11:0]有效。bit[11:0]有效。 */
td_u8 dm_major_ver; /* the major version of display management implemented. */
/* CNcomment: 显示器管理实施的主要版本 */
td_u8 dm_minor_ver; /* the minor version of display management implemented. */
/* CNcomment: 显示器管理实施的次要版本 */
td_u16 target_min_pq; /* Perceptual quantization(PQ)-encoded value of minimum display luminance */
/* CNcomment: PQ感知量化编码的最小显示亮度值 */
td_u16 target_max_pq; /* PQ-encoded value of maximum display luminance */
/* CNcomment: PQ编码的最大显示亮度值 */
td_u16 red_x; /* red primary chromaticity coordinate x, bit[11:0] valid. Real value =SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 红色主色坐标xbit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 red_y; /* red primary chromaticity coordinate y, bit[11:0] valid. Real value =SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 红色主色坐标ybit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 green_x; /* green primary chromaticity coordinate x, bit[11:0] valid. Real value =SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 绿色主色坐标xbit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 green_y; /* green primary chromaticity coordinate y, bit[11:0] valid. Real value =SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 绿色主色坐标ybit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 blue_x; /* blue primary chromaticity coordinate x, bit[11:0] valid. Real value =SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 蓝色主色坐标xbit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 blue_y; /* blue primary chromaticity coordinate y, bit[11:0] valid. Real value =SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 蓝色主色坐标ybit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
} uapi_hdmitx_dolby_v0;
/*
* EDID dolby vision capability ,for version 1
* CNcomment: Sink dolby vision能力结构体(版本1)
*/
typedef struct {
td_bool ycbcr422_12bit; /* support or not YCbCr422-12Bit dolby singal; For low-latency this flag is ingnored */
/* CNcomment: 是否支持YCbCr422-12bit杜比信号低延时时, 该标志被忽略 */
td_bool cap_2160p60; /* capable of processing a max timming 3840X2160p60/3840X2160p30 */
/* CNcomment: 能够处理的最大时序3840X2160p60/3840X2160p30 */
td_bool global_dimming; /* support(true) or not support(false) global dimming. */
/* CNcomment: 支持(true)或不支持(false)全局调光功能 */
td_bool colorimetry; /* 0: Dolby Vision HDMI sink's colorimetry is close to Rec.709,
* 1: EDR HDMI sink's colorimetry is close to P3,if Byte[9] to Byte[14] are present,
* ignores this bit. */
/* CNcomment: 0: 杜比Vision HDMI Sink的色域接近Rec.709
* 1: EDR HDMI sink端色域接近P3如果Byte[9]到Byte[14]存在,忽略此位. */
td_u8 dm_version; /* 0: based on display management v2.x;
* 1: based on the video and blending pipeline v3.x;
* 2-7: reserved. */
/* CNcomment: 0基于显示管理v2.x
* 1基于视频和混合管道 v3.x
* 2-7保留. */
td_u8 low_latency; /* 0: Supports only standard Dolby Vison;
* 1: Supports low latency with 12-bit YCbCr 4:2:2 interface;
* 2-3: reserved */
/* CNcomment: 0只支持标准的杜比版本
* 1支持12bit YCbCr 4:2:2接口的低时延
* 2-3保留 */
td_u16 target_min_lum; /* minimum display luminance = (100+50*CV)cd/m2, where CV is the value */
/* CNcomment: 显示最小亮度=(100+50*CV)cd/m2其中CV为数值 */
td_u16 target_max_lum; /* maximum display luminance = (CV/127)^2cd/m2, where CV is the value */
/* CNcomment: 显示最大亮度=(CV/127)^2cd/m2其中CV为数值 */
td_u16 red_x; /* red primary chromaticity coordinate x, bit[11:0] valid. Real value = SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 红色主色坐标xbit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 red_y; /* red primary chromaticity coordinate y, bit[11:0] valid. Real value = SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 红色主色坐标ybit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 green_x; /* green primary chromaticity coordinate x, bit[11:0] valid. Real value = SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 绿色主色坐标xbit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 green_y; /* green primary chromaticity coordinate y, bit[11:0] valid. Real value = SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 绿色主色坐标ybit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 blue_x; /* blue primary chromaticity coordinate x, bit[11:0] valid. Real value = SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 蓝色主色坐标xbit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 blue_y; /* blue primary chromaticity coordinate y, bit[11:0] valid. Real value = SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 蓝色主色坐标ybit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
} uapi_hdmitx_dolby_v1;
/*
* EDID dolby vision capability ,for version 2
* CNcomment: Sink dolby vision能力结构体(版本2)
*/
typedef struct {
td_bool ycbcr422_12bit; /* support(true) or not support(false) a YCbCr422-12Bit dolby singal */
/* CNcomment: 支持(true)或不支持(false) YCbCr422-12bit杜比信号 */
td_bool back_light_ctrl; /* supports Backlight Control */
/* CNcomment: 支持背光控制 */
td_bool global_dimming; /* support(true) or not support(false) global dimming. */
/* CNcomment: 支持(true)或不支持(false)全局调光功能 */
td_u8 dm_version; /* 0:based on display management v2.x;
* 1:based on the video and blending pipeline v3.x;
* 2-7: reserved. only support when u8VSVDBVersion = 1. */
/* CNcomment: 0基于显示管理v2.x
* 1基于视频混合管道 v3.x
* 2-7保留。仅当u8VSVDBVersion=1时支持。 */
td_u8 back_lt_min_lum; /* minimum luminance level 0:25cd/m2 1:50cd/m2 2:75cd/m2 3:100cd/m2 */
/* CNcomment: 最小亮度等级0:25cd/m2 1:50cd/m2 2:75cd/m2 3:100cd/m2 */
td_u8 interface; /* 0:support only "low latency with YCbCr422"
* 1:support both "low latency with YCbCr422" and YCbCr444/RGB_10/12bit*
* 2:support both "standard DolbyVision" and "low latency with YCbCr422"
* 3:support "standard DolbyVision" "low latency YCbCr422 YCbCr444/RGB_10/12bit" */
/* CNcomment: 0只支持“低延时YCbCr422”
* 1同时支持YCbCr422的低时延和YCbCr444/RGB_10/12bit*
* 2同时支持“标准DolbyVision”和“YCbCr422低延时”
* 3支持“标准杜比视觉”“低延时YCbCr422 YCbCr444/RGB_10/12bit” */
td_u8 y444_rgb_10b12b; /* 0:not support 1:Support YCbCr444/RGB444_10bit 2:YCbCr444/RGB444_12bit 3:reserved */
/* CNcomment: 0不支持; 1支持YCbCr444/RGB444_10bit; 2支持YCbCr444/RGB444_12bit;
* 3保留 */
td_u16 target_min_pq_v2; /* maximum display luminance, in the PQ-encoded value= 2055+target_max_pq_v2*65. */
/* CNcomment: 最大显示亮度PQ编码值=2055+target_max_pq_v2*65. */
td_u16 target_max_pq_v2; /* minimum display luminance, in the PQ-encoded value= 2055+target_max_pq_v2*65. */
/* CNcomment: 最小显示亮度PQ编码值=2055+target_max_pq_v2*65. */
td_u16 red_x; /* red primary chromaticity coordinate x, bit[11:0] valid. Real value =SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 红色主色坐标xbit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 red_y; /* red primary chromaticity coordinate y, bit[11:0] valid. Real value =SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 红色主色坐标ybit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 green_x; /* green primary chromaticity coordinate x, bit[11:0] valid. Real value =SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 绿色主色坐标xbit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 green_y; /* green primary chromaticity coordinate y, bit[11:0] valid. Real value =SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 绿色主色坐标ybit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 blue_x; /* blue primary chromaticity coordinate x, bit[11:0] valid. Real value =SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 蓝色主色坐标xbit[11:0]有效. 实际值=SUM of bit[N]*2^-(12-N) */
td_u16 blue_y; /* blue primary chromaticity coordinate y, bit[11:0] valid. Real value =SUM OF bit[N]*2^-(12-N) */
/* CNcomment: 蓝色主色坐标ybit[11:0]有效 */
} uapi_hdmitx_dolby_v2;
/*
* EDID dolby vision capability
* CNcomment: Sink dolby vision能力结构体
*/
typedef struct {
td_bool support_v0; /* V0 support */ /* CNcomment: V0支持 */
td_bool support_v1; /* V1 support */ /* CNcomment: V1支持 */
td_bool support_v2; /* V2 support */ /* CNcomment: V2支持 */
uapi_hdmitx_dolby_v0 v0; /* V0 detail */ /* CNcomment: V0详细能力 */
uapi_hdmitx_dolby_v1 v1; /* V1 detail */ /* CNcomment: V1详细能力 */
uapi_hdmitx_dolby_v2 v2; /* V2 detail */ /* CNcomment: V2详细能力 */
} uapi_hdmitx_dolby_info;
/*
* Sink VRR capability, see Spec HDMITX2.1 Table 10-6
* CNcomment: Sink VRR能力结构体,见协议HDMITX2.1 Table 10-6
*/
typedef struct {
td_bool fva;
td_bool cnm_vrr;
td_bool cinema_vrr;
td_bool m_delta;
td_bool fapa_start_locat;
td_bool allm;
td_u16 vrr_min;
td_u16 vrr_max;
} uapi_hdmitx_vrr_info;
/*
* Sink cuva capability.
* CNcomment: Sink CUVA能力结构体
*/
typedef struct {
td_u8 system_start_code; /* support version code. */ /* CNcomment: 支持的CUVA版本号 */
td_u8 version_code; /* support HDMI version code. */ /* CNcomment: 支持HDMI系统版本号 */
td_u32 display_max_lum; /* display maximum luminance. max display is display_max_lum/10000. */
/* CNcomment: 支持的最大显示亮度. max display最终值是display_max_lum/10000. */
td_u32 display_min_lum; /* display minimum luminance. min display is display_min_lum/10000. */
/* CNcomment: 支持的最小显示亮度. min display最终值是display_min_lum/10000. */
td_bool monitor_mode_support; /* monitor mode support. */ /* CNcomment: 显示终端对监视器适配模式的支持能力 */
td_bool rx_mode_support; /* rx mode support. */ /* CNcomment: 显示终端对接收端适配模式的支持能力 */
} uapi_hdmitx_cuva_info;
/*
* Sink speaker capability,see CTA-861-G Page 104
* CNcomment: Sink 扬声器能力结构体,参考CTA-861-G 104页
*/
typedef struct {
td_bool fl_fr; /* Front Left and Front Right(FL/FR) */ /* CNcomment: 左前、右前(FL/FR) */
td_bool lfe; /* Low Frequency Effect(LFE) */ /* CNcomment: 低频效应(LFE) */
td_bool fc; /* Front Center(FC) */ /* CNcomment: 前部中心(FC) */
td_bool rl_rr; /* Rear Left and Rear Right(RL/RR) */ /* CNcomment: 左后右后(RL/RR) */
td_bool rc; /* Rear Center(RC) */ /* CNcomment: 后部中心(FC) */
td_bool flc_frc; /* Front Left Center and Front Right Center(FLC/FRC) */ /* CNcomment: 前左中和前右中(FLC/FRC) */
td_bool rlc_rrc; /* Front Left Center and Rear Right Center(FLC/RRC) */ /* CNcomment: 前左中 后右中(FLC/RRC) */
td_bool flw_frw; /* Front Left Wide and Front Right Wide(FLW/FRW) */ /* CNcomment: 左前宽右前宽(FLW/FRW) */
td_bool flh_frh; /* Front Left High and Front Right High(FLH/FRH) */ /* CNcomment: 左前高右前高(FLH/FRH) */
td_bool tc; /* Top Center(TC) */ /* CNcomment: 顶部中心(TC) */
td_bool fch; /* Front Center High(FCH) */ /* CNcomment: 前部中心高配(FCH) */
} uapi_hdmitx_audio_speaker;
/*
* Short Audio Descriptors. see CTA-861-G 7.5.2 Audio Data Block
* CNcomment: 简式音频描述符.见 CTA-861-G 7.5.2 Audio Data Block
*/
typedef struct {
td_u32 fmt_code; /* Audio Format Code */ /* CNcomment: 音频格式编码 */
td_u32 ext_code; /* Audio Coding Extension Type Code */ /* CNcomment: 音频编码扩展类型编码 */
td_u32 max_channel; /* Max Number of channels. Audio Format Code 1 to 14; Audio Coding Extension Type Codes 4 to 6,
* 8 to 10; Audio Coding Extension Type 0x0D (L-PCM 3D Audio), bits MC4:MC0 */
/* CNcomment: 最大通道数。音频格式编码1~14音频编码扩展类型编码4~68~10
* 音频编码扩展类型0x0DL-PCM 3D音频bits MC4:MC0 */
td_bool samp_32k;
td_bool samp_44p1k;
td_bool samp_48k;
td_bool samp_88p2k;
td_bool samp_96k;
td_bool samp_176p4k;
td_bool samp_192k;
td_bool width_16; /* 16bit.Only to Audio Format Code = 1 (L-PCM) & Audio Extension Type Code 13 (L-PCM 3D Audio) */
/* CNcomment: 16bit. 仅音频格式编码=1 (L-PCM) &音频扩展类型编码13 L-PCM 3D音频 */
td_bool width_20; /* 20bit.Only to Audio Format Code = 1 (L-PCM) & Audio Extension Type Code 13 (L-PCM 3D Audio) */
/* CNcomment: 20bit. 仅音频格式编码=1 (L-PCM) &音频扩展类型编码13 L-PCM 3D音频 */
td_bool width_24; /* 24bit.Only to Audio Format Code = 1 (L-PCM) & Audio Extension Type Code 13 (L-PCM 3D Audio) */
/* CNcomment: 24bit. 仅音频格式编码=1 (L-PCM) &音频扩展类型编码13 L-PCM 3D音频 */
td_u32 max_bit_rate; /* Maximum bit rate in Hz.Only to Audio Format Codes 2 to 8 */
/* CNcomment: 最大比特率(hz). 仅限音频格式代码2到8 */
td_u32 dependent; /* Audio Format Code dependent value.Only to Audio Format Codes 9 to 13 */
/* CNcomment: 音频格式代码依赖值. 仅针对音频格式代码9到13 */
td_u32 profile; /* Profile. Only to Audio Format Codes 14 (WMA pro) */
/* CNcomment: 配置文件. 只对音频格式编码14(WMA pro) */
td_bool len_1024tl; /* 1024_TL. AAC audio frame lengths 1024_TL. Only to extension Type Codes 4 to 6 */
/* CNcomment: 1024_TL. AAC音频帧长1024_TL。只对扩展类型代码4-6 */
td_bool len_960tl; /* 960_TL. AAC audio frame lengths 960_TL. Only to extension Type Codes 4 to 6 */
/* CNcomment: 960_TL. AAC音频帧长为960_TL。仅适用于扩展类型代码4至6 */
td_bool mps_l; /* MPS_L. Only to Extension Type Codes 8 to 10 */
/* CNcomment: MPS_L. 只对扩展类型代码8~10 */
} uapi_hdmitx_audio_fmt_info;
/*
* Defines Audio capability information
* CNcomment: 音频能力信息定义
*/
typedef struct {
td_bool basic_support; /* basic audio support. Basic Audio-Uncompressed, two channel, digital audio. */
/* CNcomment: 基本音频支持。基本音频-非压缩,双通道,数字音频. */
td_u32 audio_fmt_cnt; /* Short Audio Descriptors audio format support total number.
* It must less than UAPI_HDMITX_MAX_AUDIO_CNT */
/* CNcomment: ShortAudioDescriptors音频格式支持总数。必须小于UAPI_HDMITX_MAX_AUDIO_CNT */
uapi_hdmitx_audio_fmt_info sad[UAPI_HDMITX_MAX_AUDIO_CNT]; /* Short Audio Descriptors audio format.
* see CTA-861-G 7.5.2 */
/* CNcomment: 短音频描述符音频格式。
* 见 CTA-861-G 7.5.2 */
} uapi_hdmitx_audio_info;
/*
* Defines EDID version
* CNcomment:定义EDID 版本参数
*/
typedef struct {
td_u8 version;
td_u8 revision;
} uapi_hdmitx_edid_version;
/*
* Sink capability information
* CNcomment: 对端能力信息
*/
typedef struct {
uapi_hdmitx_manufacture_info manufacture; /* Sink manufacture infomation struct */
/* CNcomment: sink端制造厂商信息结构 */
uapi_hdmitx_edid_version edid_version; /* EDID version */ /* CNcomment: EDID版本 */
uapi_hdmitx_colorimetry colorimetry; /* Sink colorimety capability infomation struct */
/* CNcomment: Sink色域能力信息结构体 */
uapi_hdmitx_latency latency; /* EDID latency capability */ /* CNcomment: EDID延时能力 */
uapi_hdmitx_disp_para disp_para; /* EDID max display parameters struct */
/* CNcomment: EDID最大显示参数结构体 */
uapi_hdmitx_audio_speaker speaker; /* Sink speaker capability */ /* CNcomment: sink端的扬声器能力 */
uapi_hdmitx_audio_info audio; /* Audio capability */ /* CNcomment: 音频能力 */
uapi_hdmitx_dolby_info dolby; /* EDID dolby vision capability */ /* CNcomment: EDID杜比版本能力 */
uapi_hdmitx_hdr_info hdr; /* Sink HDR capability struct */ /* CNcomment: sink端HDR能力结构体 */
uapi_hdmitx_vrr_info vrr; /* Sink VRR capability */ /* CNcomment: sink端VRR能力 */
uapi_hdmitx_cuva_info cuva; /* Sink CUVA capability */ /* CNcomment: sink端CUVA能力 */
td_u8 reserved;
} uapi_hdmitx_sink_info;
/*
* Defines HDCP KEY version enum
* CNcomment: 定义HDCP KEY版本枚举
*/
typedef enum {
UAPI_HDMITX_HDCP_KEY_VER_1X, /* HDCP1X KEY version */ /* CNcomment: HDCP1X版本KEY */
UAPI_HDMITX_HDCP_KEY_VER_MAX
} uapi_hdmitx_hdcp_key_ver;
/*
* Defines HDCP KEY struct
* CNcomment: 定义HDCP KEY结构体
*/
typedef struct {
uapi_hdmitx_hdcp_key_ver key_ver; /* KEY version */ /* CNcomment: KEY版本 */
td_u8 *data; /* Pointer of key data */ /* CNcomment: key数据指针 */
td_s32 length; /* Length of key data, in bytes */ /* CNcomment: key数据长度单位为字节 */
} uapi_hdmitx_hdcp_key;
/*
* HDCP SRM struct
* CNcomment: HDCP SRM(失效列表)结构体
*/
typedef struct {
td_u8 *data; /* Pointer of SRM data */ /* CNcomment: SRM数据指针 */
td_s32 length; /* Length of SRM data, in bytes */ /* CNcomment: SRM数据长度单位为字节 */
} uapi_hdmitx_hdcp_srm;
/*
* HDCP capability struct
* CNcomment: HDCP 能力结构体
*/
typedef struct {
td_bool support14; /* sink support HDCP1.4 version */ /* CNcomment: sink支持HDCP1.4版本 */
td_bool support2x; /* sink support HDCP2.X(2.2/2.3) version */ /* CNcomment: sink支持HDCP2.X(2.2/2.3)版本 */
} uapi_hdmitx_hdcp_cap;
/*
* Defines HDMITX HDCP mode enum
* CNcomment: 定义HDCP 模式枚举
*/
typedef enum {
UAPI_HDMITX_HDCP_MODE_AUTO, /* AUTO mode,preferred higher capable protocol version */
/* CNcomment: 自动模式,优选具备能力的高版本 */
UAPI_HDMITX_HDCP_MODE_14, /* HDCP1.4 mode */ /* CNcomment: HDCP1.4 认证模式 */
UAPI_HDMITX_HDCP_MODE_2X, /* HDCP2.X(2.2/2.3) mode */ /* CNcomment: HDCP2.X(2.2/2.3) 认证模式 */
UAPI_HDMITX_HDCP_MODE_MAX
} uapi_hdmitx_hdcp_mode;
/*
* Defines HDCP version enum
* CNcomment: 定义HDCP 版本枚举
*/
typedef enum {
UAPI_HDMITX_HDCP_VER_NONE, /* no authentication */ /* CNcomment: 未启动HDCP认证 */
UAPI_HDMITX_HDCP_VER_14, /* HDCP1.4 version */ /* CNcomment: HDCP1.4版本 */
UAPI_HDMITX_HDCP_VER_2X, /* HDCP2.X(2.2/2.3) version */ /* CNcomment: HDCP2.X(2.2/2.3)版本 */
UAPI_HDMITX_HDCP_VER_MAX
} uapi_hdmitx_hdcp_ver;
/*
* HDCP error code
* CNcomment: HDMITX HDCP错误码
*/
typedef enum {
UAPI_HDMITX_HDCP_ERR_UNDO = 0x00, /* do not start hdcp. */ /* CNcomment: 未启动HDCP认证 */
UAPI_HDMITX_HDCP_ERR_NONE, /* no authentication error. */ /* CNcomment: 无认证错误 */
UAPI_HDMITX_HDCP_ERR_PLUG_OUT, /* cable plug out. */ /* CNcomment: 线缆拔出 */
UAPI_HDMITX_HDCP_ERR_NO_SIGNAL, /* signal output disable. */ /* CNcomment: 未输出信号 */
UAPI_HDMITX_HDCP_ERR_NO_KEY, /* do not load key. */ /* CNcomment: 未加载key */
UAPI_HDMITX_HDCP_ERR_INVALID_KEY, /* key is invalid. */ /* CNcomment: 加载了无效key */
UAPI_HDMITX_HDCP_ERR_DDC, /* DDC link error. */ /* CNcomment: DDC通道错误 */
UAPI_HDMITX_HDCP_ERR_ON_SRM, /* on revocation list. */ /* CNcomment: 在失效列表中 */
UAPI_HDMITX_HDCP_ERR_NO_CAP, /* no hdcp capability. */ /* CNcomment: 设备不支持hdcp */
UAPI_HDMITX_HDCP_ERR_TYPE1_NO_2X_CAP, /* no hdcp2x capability on stream type 1. */
/* CNcomment: 流类型1上没有hdcp2x功能 */
UAPI_HDMITX_HDCP_ERR_TYPE1_ON_1X_MODE, /* set only hdcp1x mode on stream type 1. */
/* CNcomment: 在流类型1上仅支持hdcp1x模式 */
UAPI_HDMITX_HDCP_1X_NO_CAP = 0x10, /* no hdcp1.4 capability. */ /* CNcomment: 当前制式或设备不支持hdcp1.x */
UAPI_HDMITX_HDCP_1X_BCAP_FAIL, /* read BCAP failed. */ /* CNcomment: 读取BCAP失败 */
UAPI_HDMITX_HDCP_1X_BSKV_FAIL, /* read BKSV failed. */ /* CNcomment: 读取BKSV失败 */
UAPI_HDMITX_HDCP_1X_INTEGRITY_FAIL_R0, /* R0(R0') integrety failure. */ /* CNcomment: R0(R0')校验失败 */
UAPI_HDMITX_HDCP_1X_WATCHDOG_TIMEOUT, /* Repeater watch dog timeout. */ /* CNcomment: 看门狗超时 */
UAPI_HDMITX_HDCP_1X_VI_CHCECK_FAIL, /* Vi(Vi') check failed. */ /* CNcomment: Vi(Vi')校验失败 */
UAPI_HDMITX_HDCP_1X_EXCEEDED_TOPOLOGY, /* Exceeded toplogy. */ /* CNcomment: 超出设备个数或topology层限制 */
UAPI_HDMITX_HDCP_1X_INTEGRITY_FAIL_RI, /* Ri(Ri') integrety failure. */ /* CNcomment: Ri(Ri')校验失败 */
UAPI_HDMITX_HDCP_2X_NO_CAP = 0x20, /* no hdcp2x capability. */ /* CNcomment: 设备不支持hdcp2x */
UAPI_HDMITX_HDCP_2X_SIGNATURE_FAIL, /* signature error. */ /* CNcomment: 签名错误 */
UAPI_HDMITX_HDCP_2X_MISMATCH_H, /* mismatch H(H'). */ /* CNcomment: H(H')不匹配 */
UAPI_HDMITX_HDCP_2X_AKE_TIMEOUT, /* AKE timeout. */ /* CNcomment: AKE超时 */
UAPI_HDMITX_HDCP_2X_LOCALITY_FAIL, /* locality check failed. */ /* CNcomment: 本地校验失败 */
UAPI_HDMITX_HDCP_2X_REAUTH_REQ, /* REAUTH_REQ request. */ /* CNcomment: 重认证请求 */
UAPI_HDMITX_HDCP_2X_WATCHDOG_TIMEOUT, /* watchdog timeout. */ /* CNcomment: 看门狗超时 */
UAPI_HDMITX_HDCP_2X_V_MISMATCH, /* mismatch V(V'). */ /* CNcomment: V(V')不匹配 */
UAPI_HDMITX_HDCP_2X_ROLL_OVER, /* no roll-over of seq_num_V. */ /* CNcomment: 未检测到seq_num_V */
UAPI_HDMITX_HDCP_2X_EXCEEDED_TOPOLOGY /* Exceeded toplogy. */ /* CNcomment: 超出设备个数或topology层限制 */
} uapi_hdmitx_hdcp_err;
/*
* Defines HDCP status struct
* CNcomment: 定义HDCP 状态结构体
*/
typedef struct {
td_bool auth_start; /* HDCP authentication start. */ /* CNcomment: HDCP认证启动 */
td_bool auth_success; /* HDCP authentication success. */ /* CNcomment: HDCP认证成功 */
td_u32 cur_reauth_times; /* HDCP current re-authen times. */ /* CNcomment: HDCP当前重认证次数 */
uapi_hdmitx_hdcp_ver version; /* HDCP authentication version. */ /* CNcomment: HDCP认证版本 */
uapi_hdmitx_hdcp_err err_code; /* HDCP authentication error code. */ /* CNcomment: HDCP认证错误码 */
} uapi_hdmitx_hdcp_status;
/*
* Defines the status of logical address enum
* CNcomment: 定义CEC 逻辑地址状态枚举
*/
typedef enum {
UAPI_HDMITX_CEC_ADDR_STATUS_VALID, /* The logical address is valid */ /* CNcomment: 当前逻辑地址有效 */
UAPI_HDMITX_CEC_ADDR_STATUS_INVALID, /* The logical address is invalid */ /* CNcomment: 当前逻辑地址无效 */
UAPI_HDMITX_CEC_ADDR_STATUS_NOT_CONFIG, /* The logical address is not set */ /* CNcomment: 未设置过逻辑地址 */
UAPI_HDMITX_CEC_ADDR_STATUS_CONFIGURING, /* The driver is querying the available logical address now */
/* CNcomment: 驱动正在查询可用的逻辑地址 */
} uapi_hdmitx_cec_logic_addr_status;
/*
* The event type of CEC
* CNcomment: CEC事件类型
*/
typedef enum {
UAPI_HDMITX_CEC_EVENT_STATUS_CHANGE, /* CEC status was changed, e.g the logical or physical address was changed */
/* CNcomment: 表示CEC状态发生了变化比如逻辑地址或者物理地址发生了变化 */
UAPI_HDMITX_CEC_EVENT_RECEIVED, /* Receive a CEC message */ /* CNcomment: 接收到CEC消息 */
} uapi_hdmitx_cec_event_type;
/*
* The status of CEC
* CNcomment: CEC的状态
*/
typedef struct {
td_u16 logic_addr; /* Current logical address */ /* CNcomment: 当前的逻辑地址 */
td_u16 physic_addr; /* Current physical address */ /* CNcomment: 当前物理地址 */
uapi_hdmitx_cec_logic_addr_status addr_status; /* the status of logical address */
/* CNcomment: 逻辑地址配置状态 */
} uapi_hdmitx_cec_status;
/*
* The data of CEC event
* CNcomment: CEC事件数据
*/
typedef union {
uapi_hdmitx_cec_status cec_status; /* The current status of CEC */ /* CNcomment: 当前CEC的状态 */
uapi_cec_msg rx_msg; /* The message that received */ /* CNcomment: 接收到的CEC消息 */
} uapi_hdmitx_cec_event_data;
/*
* The callback function type of CEC
* CNcomment: CEC回调函数类型定义
*/
typedef td_void (*uapi_hdmitx_callback_pfn)(uapi_hdmitx_id id, uapi_hdmitx_cec_event_type type,
const uapi_hdmitx_cec_event_data *data, td_void *private_data);
/*
* The callback struct of CEC
* CNcomment: CEC回调结构体定义
*/
typedef struct {
uapi_hdmitx_callback_pfn func; /* The callback function type of CEC */ /* CNcomment: CEC回调函数类型定义 */
td_void *private_data; /* Private callback paramters */ /* CNcomment: 用户私有回调参数 */
} uapi_hdmitx_cec_callback;
/*
* brief init function. CNcomment: 初始化 CNend
* attention User needs to call this function before call other hdmitx function
* CNcomment: 用户需在调用其他HDMI TX接口前调用这个接口 CNend
* param CNcomment: 无 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_hdmitx_init(td_void);
/*
* brief deinit function. CNcomment: 去初始化 CNend
* attention User needs to call this function before the application exits.
* CNcomment: 用户需在应用对退出前调用这个接口 CNend
* param CNcomment:无 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_hdmitx_deinit(td_void);
/*
* brief register callback function. CNcomment: 注册回调函数 CNend
* attention User needs to register a callback function to handle events defined in uapi_hdmitx_event_type.
* CNcomment: 用户需注册一个回调函数用于处理uapi_hdmitx_event_type定义的事件. CNend
* param[in] hdmitx_id hdmi device id. CNcomment: HDMITX设备ID CNend
* param[in] callback_func callback function CNcomment: 回调函数 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see uapi_hdmitx_callback and uapi_hdmitx_event_type
*/
td_s32 uapi_hdmitx_register_callback(uapi_hdmitx_id hdmitx_id, const uapi_hdmitx_callback *callback_func);
/*
* brief unregister callback function. CNcomment: 注销回调函数 CNend
* attention This function must be called when exiting the callback service registered by
* uapi_hdmitx_register_callback.
* CNcomment: 退出由uapi_hdmitx_register_callback注册的回调服务时该函数必须调用. CNend
* param[in] hdmitx_id hdmi device id.CNcomment: HDMITX设备ID CNend
* param[in] callback_func callback function CNcomment: 回调函数 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see uapi_hdmitx_callback
*/
td_s32 uapi_hdmitx_unregister_callback(uapi_hdmitx_id hdmitx_id, const uapi_hdmitx_callback *callback_func);
/*
* brief get current hdmi status. CNcomment: 获取hdmi当前的状态 CNend
* attention \n
* N/A CNcomment: 无 CNend
* param[in] hdmitx_id hdmi device id. CNcomment: HDMITX设备ID CNend
* param[out] hdmi_status hdmi cuttent status. CNcomment: HDMITX当前状态 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see uapi_hdmitx_status
*/
td_s32 uapi_hdmitx_get_status(uapi_hdmitx_id hdmitx_id, uapi_hdmitx_status *hdmi_status);
/*
* brief read sink's edid raw data. CNcomment: 读取EDID裸数据 CNend
* attention \n
* N/A CNcomment: 无 CNend
* param[in] hdmitx_id hdmi device id. CNcomment: HDMITX设备ID CNend
* param[in/out] edid_buf pointer to the buffer allocated externally.
* CNcomment: 获取EDID裸数据的buffer指针用户需自己分配好buffer。 CNend
* param[in] buf_size size of the edid raw data bufferthe recommended buffer size is 512.
* CNcomment: EDID裸数据buffer大小建议定义为512。不排除将来有设备的EDID裸数据长度超过512。 CNend
* param[out] edid_len the real lenth of edid raw data. CNcomment: 获取EDID裸数据实际长度 CNend
* param[in] force when true, force to re-read EDID from sink, or read EDID from current copy.
* CNcomment: 当设置为true,强制从sink重新读取EDID否则从当前内存备份中获取。 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_hdmitx_read_edid(uapi_hdmitx_id hdmitx_id, td_u8 *edid_buf,
td_u32 buf_size, td_u32 *edid_len, td_bool force);
/*
* brief get sink's capability information. CNcomment: 获取对端能力信息。 CNend
* attention \n
* N/A CNcomment: 无 CNend
* param[in] hdmitx_id hdmi device id. CNcomment: HDMITX设备ID CNend
* param[in] sink_info pointer to the memory of the sink's capability information structure.
* CNcomment: 对端能力信息指针 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see uapi_hdmitx_sink_info
*/
td_s32 uapi_hdmitx_get_sink_info(uapi_hdmitx_id hdmitx_id, uapi_hdmitx_sink_info *sink_info);
/*
* brief get available capability. CNcomment: 获取有效能力信息。 CNend
* attention \n
* N/A CNcomment: 无 CNend
* param[in] hdmitx_id hdmi device id. CNcomment: HDMITX设备ID CNend
* param[in] avail_cap pointer to the memory of the available capability structure. CNcomment: 有效能力信息指针 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see uapi_hdmitx_avail_cap
*/
td_s32 uapi_hdmitx_get_avail_capability(uapi_hdmitx_id hdmitx_id, uapi_hdmitx_avail_cap *avail_cap);
/*
* brief get available modes. CNcomment: 获取有效制式集。 CNend
* attention The user needs to allocate a memory buffer. The recommended number is set to @mode_cnt
* in uapi_hdmitx_avail_cap. CNcomment: 用户需分配存储缓冲区建议个数设置为uapi_hdmitx_avail_cap中的@mode_cnt CNend
* param[in] hdmitx_id hdmi device id. CNcomment: HDMITX设备ID CNend
* param[in] avail_modes pointer to the memory buffer of the available modes.
* CNcomment: 有效制式集存储缓冲区指针。 CNend
* param[in] mode_cnt available modes count assigned by user. CNcomment: 用户分配的有效制式单元个数 CNend
* param[out] avail_mode_cnt pointer to the memory of the real available modes count.
* CNcomment: 真实返回的有效制式个数 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see uapi_hdmitx_avail_mode
*/
td_s32 uapi_hdmitx_get_avail_modes(uapi_hdmitx_id hdmitx_id,
uapi_hdmitx_avail_mode *avail_modes, td_u32 mode_cnt, td_u32 *avail_mode_cnt);
/*
* brief load HDCP KEY. CNcomment: 加载HDCP KEY CNend
* attention The HDCP1X version KEY is purchased and loaded by the user from the HDCP organization.
* CNcomment: HDCP1X版本KEY由用户从HDCP组织购买并加载。 CNend
* param[in] hdmitx_id hdmi device id. CNcomment: HDMITX设备ID CNend
* param[in] key key struct pointer CNcomment: key结构指针 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see uapi_hdmitx_hdcp_key
*/
td_s32 uapi_hdmitx_hdcp_load_key(uapi_hdmitx_id hdmitx_id, const uapi_hdmitx_hdcp_key *key);
/*
* brief set SRM. CNcomment: 设置SRM数据 CNend
* attention
* 1.Setting SRM multiple times is subject to the last succesful one.
* 2.The SRM will be updated from time to time and will be obtained from the official HDCP website by users.
* 3.The kernel does not set SRM by default.
* CNcomment:
* 1.多次设置SRM则以最后一次成功的为准
* 2.失效名单会不定期更新由用户从HDCP官方网站获取
* 3.内核默认不设置失效名单
* CNend
* param[in] hdmitx_id hdmi channel id. CNcomment: HDMITX设备ID CNend
* param[in] srm pointer to SRM raw data CNcomment: SRM结构指针 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see uapi_hdmitx_hdcp_srm
*/
td_s32 uapi_hdmitx_hdcp_set_srm(uapi_hdmitx_id hdmitx_id, const uapi_hdmitx_hdcp_srm *srm);
/*
* brief get sink's HDCP capability. CNcomment: 获取Sink设备的HDCP能力 CNend
* attention It is suggested that user gets more times until retval is TD_SUCCESS.
* CNcomment: 建议用户调用多次获取HDCP能力直到返回值为TD_SUCCESS。 CNend
* param[in] hdmitx_id hdmi device id. CNcomment: HDMITX设备ID CNend
* param[out] hdcp_cap the HDCP capability of the sink. CNcomment: SINK的HDCP能力 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see uapi_hdmitx_hdcp_cap
*/
td_s32 uapi_hdmitx_hdcp_get_cap(uapi_hdmitx_id hdmitx_id, uapi_hdmitx_hdcp_cap *hdcp_cap);
/*
* brief set HDCP re-authen times. CNcomment: 设置HDCP失败重认证次数 CNend
* attention
* 1. It can be set in the HDCP start or stop status.
* 2. Kernel will re-authen until fail-times reached the setting times.
* 3. The default setting times is UAPI_HDMITX_HDCP_REAUTH_DEFAULT,kernel will re-authentication every fail-time.
* 4. The re-authen times do not work if it is not ready to authentication.Such as cable plug out,
* no signal,invalid key,id is on SRM,HDMI connector physical damageetc.
* CNcomment:
* 1.HDCP启动/停止状态下均可设置重认证次数
* 2.设置成功后从下一次与sink进行HDCP认证起连续重认证失败达到设置的次数后上报HDCP握手失败事件并停止认证
* 3.设置为UAPI_HDMITX_HDCP_REAUTH_DEFAULT(默认值),表示内核在每次认证失败时都在协议规定时间内重认证
* 4.因未达到准备状态导致的失败不进行重认证,设定次数无效。如:线缆拔出、未输出信号、KEY无效、ID失效、HDMI端口物理损坏等
* CNend
* param[in] hdmitx_id hdmi device id. CNcomment: HDMITX设备ID CNend
* param[in] reauth_times re-authen times CNcomment: 重认证次数 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_hdmitx_hdcp_set_auth_times(uapi_hdmitx_id hdmitx_id, td_u32 reauth_times);
/*
* brief start HDCP authentication. CNcomment: 启动HDCP认证 CNend
* attention Users should not choose HDCP mode that is not supported by sink capability.
* CNcomment: 用户不应选择sink能力不支持的HDCP模式。 CNend
* param[in] hdmitx_id hdmi device id. CNcomment: HDMITX设备ID CNend
* param[in] hdcp_mode hdcp mode. CNcomment: HDCP认证模式 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see uapi_hdmitx_hdcp_mode
*/
td_s32 uapi_hdmitx_hdcp_start_auth(uapi_hdmitx_id hdmitx_id, uapi_hdmitx_hdcp_mode hdcp_mode);
/*
* brief stop HDCP authentication. CNcomment: 停止HDCP认证 CNend
* param[in] hdmitx_id hdmi device id. CNcomment: HDMITX设备ID CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_hdmitx_hdcp_stop_auth(uapi_hdmitx_id hdmitx_id);
/*
* brief get HDCP status. CNcomment: 获取HDCP状态 CNend
* attention It is recommended that the user call the interface after capturing the HDCP event,
* and handle it according to different status.
* CNcomment: 建议用户在获取HDCP事件后调用该接口并根据不同的状态做相应处理 CNend
* param[in] hdmitx_id hdmi device id. CNcomment: HDMITX设备ID CNend
* param[in] hdcp_status hdcp status. CNcomment: HDCP认证状态 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::please refer to the err code definition of mpi. CNcomment: 请参考MPI错误码 CNend
* see uapi_hdmitx_hdcp_status
*/
td_s32 uapi_hdmitx_hdcp_get_status(uapi_hdmitx_id hdmitx_id, uapi_hdmitx_hdcp_status *hdcp_status);
/*
* brief Enable or disable the CEC interface. CNcomment: 打开/关闭CEC接口 CNend
* attention Multiple processes are not supported. CNcomment: 不支持多进程 CNend
* param[in] id The HDMI interface. CNcomment: HDMI端口 CNend
* param[in] enable True-enbale CEC, false-disable CEC. CNcomment: true-打开CECfalse-关闭CEC CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::SOC_ERR_HDMITX_BUS_BUSY CEC already open by other process. CNcomment: CEC已经被其他进程占用 CNend
* retval ::SOC_ERR_HDMITX_INVALID_PARA The input parameter was invalid. CNcomment: 非法输入参数 CNend
* retval ::TD_FAILURE Others error. CNcomment: 其他错误 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_hdmitx_cec_enable(uapi_hdmitx_id id, td_bool enable);
/*
* brief Register the Callback function of CEC. CNcomment: 注册CEC回调函数 CNend
* attention Can only register one callback function by a process. You shall call this function
* before uapi_hdmitx_cec_set_device_type and after uapi_hdmitx_cec_enable.
* CNcomment: 一个进程仅能注册一个回调函数. 必须在uapi_hdmitx_cec_enable之后和uapi_hdmitx_cec_set_device_type之前调
* 用此接口. CNend
* param[in] id The HDMI interface. CNcomment: HDMI端口 CNend
* param[in] callback The pointer of the callback funtion that you want to register.
* CNcomment: 需要注册的回调函数指针 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::SOC_ERR_HDMITX_DEV_NOT_OPEN CEC not open. CNcomment:CEC没有打开 CNend
* retval ::SOC_ERR_HDMITX_CALLBACK_ALREADY Callback function already register. CNcomment: 已经注册了CEC回调函数 CNend
* retval ::SOC_ERR_HDMITX_INVALID_PARA The input parameter was invalid. CNcomment: 非法输入参数 CNend
* retval ::TD_FAILURE Others error. CNcomment: 其他错误 CNend
* see uapi_hdmitx_cec_callback \n
*/
td_s32 uapi_hdmitx_cec_register_callback(uapi_hdmitx_id id, const uapi_hdmitx_cec_callback *callback);
/*
* brief Unregister the Callback function of CEC. CNcomment: 注销CEC回调函数 CNend
* attention You shall call this function before disable CEC. CNcomment: 必须在关闭CEC之前调用此接口. CNend
* param[in] id The HDMI interface CNcomment: HDMI端口 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::SOC_ERR_HDMITX_DEV_NOT_OPEN CEC not open. CNcomment: CEC没有打开 CNend
* retval ::SOC_ERR_HDMITX_INVALID_PARA The input parameter was invalid. CNcomment: 非法输入参数 CNend
* retval ::TD_FAILURE Others error. CNcomment: 其他错误 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_hdmitx_cec_unregister_callback(uapi_hdmitx_id id);
/*
* brief Get the current status of CEC. CNcomment: 获取当前CEC的状态 CNend
* attention
* param[in] id The HDMI interface. CNcomment: HDMI端口 CNend
* param[in] status A return value of the current status of CEC. CNcomment: 返回当前CEC状态 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::SOC_ERR_HDMITX_DEV_NOT_OPEN CEC not open. CNcomment: CEC没有打开 CNend
* retval ::SOC_ERR_HDMITX_INVALID_PARA The input parameter was invalid. CNcomment: 非法输入参数 CNend
* retval ::TD_FAILURE Others error. CNcomment: 其他错误 CNend
* see uapi_hdmitx_cec_status \n
*/
td_s32 uapi_hdmitx_cec_get_status(uapi_hdmitx_id id, uapi_hdmitx_cec_status *status);
/*
* brief Config the device type of CEC. CNcomment: 设置CEC设备类型 CNend
* attention The device type must be set before send or receive any messages. Be carefull, all messages in
* transmit queue as well as in receive queue will lost when change the device type.
* CNcomment: 必须在发送或者接收CEC消息之前设置设备类型。注意中途改变设备发送队列和接收队列中所有的消息都会丢失。
* CNend
* param[in] id The HDMI interface. CNcomment: HDMI端口 CNend
* param[in] device_type The device type want to set. CNcomment: 希望设置的设备类型 CNend
* retval ::TD_SUCCESS Success. CNcomment: 成功 CNend
* retval ::SOC_ERR_HDMITX_DEV_NOT_OPEN CEC not open. CNcomment: CEC没有打开 CNend
* retval ::SOC_ERR_HDMITX_FEATURE_NO_SUPPORT An unsupported logical address is set.
* CNcomment: 设置了一个不支持设备类型 CNend
* retval ::SOC_ERR_HDMITX_INVALID_PARA The input parameter was invalid. CNcomment: 非法输入参数 CNend
* retval ::SOC_ERR_HDMITX_NO_CALLBACK Callback funtion was not registered, you must register the callback funtion
* before set logical address. CNcomment: 回调函数没有注册,请先注册回调函数 CNend
* retval ::TD_FAILURE Others error. CNcomment: 其他错误 CNend
* see uapi_cec_device_type \n
*/
td_s32 uapi_hdmitx_cec_set_device_type(uapi_hdmitx_id id, td_u8 device_type);
/*
* brief Transmit a CEC message. CNcomment: 发送一个CEC消息 CNend
* attention This call will block utill the transmit was completed, and the transmit status was returned.
* CNcomment: 调用会阻塞直到发送完成,并返回发送状态 CNend
* param[in] id The HDMI interface CNcomment: HDMI端口 CNend
* param msg The message need to transmit. CNcomment: 待发送的消息 CNend
* retval ::TD_SUCCESS Indicate that the message is successfully sent and acknowledged.
* CNcomment: 表示消息发送成功,并且收到应答 CNend
* retval ::SOC_ERR_HDMITX_DEV_NOT_OPEN CEC not open. CNcomment: CEC没有打开 CNend
* retval ::SOC_ERR_HDMITX_NO_LOGIC_ADDR The logical address is not set, or the logical address is querying now.
* CNcomment: 未设置逻辑地址,或者驱动正在查询可用的逻辑地址 CNend
* retval ::SOC_ERR_HDMITX_MSG_NACK Indicate that the message is successfully sent and is not acknowledged.
* CNcomment: 表示发送的CEC消息没有应答 CNend
* retval ::SOC_ERR_HDMITX_MSG_FAILED Indicate that the message sent is failed.
* CNcomment: 表示CEC消息发送成功但没有收到应答 CNend
* retval ::SOC_ERR_HDMITX_INVALID_PARA The input parameter was invalid. CNcomment: 非法输入参数 CNend
* retval ::TD_FAILURE Others error. CNcomment: 其他错误 CNend
* see uapi_cec_msg \n
*/
td_s32 uapi_hdmitx_cec_send_msg(uapi_hdmitx_id id, const uapi_cec_msg *msg);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif /* UAPI_HDMITX_H */