平台:amlogic
Android version :Android7.1
Linux version 3.14.29
我这里主要是跟了一下amlogic android7.1的uboot和kernel的hdmi显示部分的流程代码,主要是为了解决一个开机概率性花屏的问题。
分析原因:
跟uboot的环境变量设置有关:
系统上层起来之后会在vendor那里设置环境变量colorattribute的属性值,这里会设置为
./vendor/amlogic/frameworks/services/systemcontrol/FormatColorDepth.h:31:#define UBOOTENV_COLORATTRIBUTE “ubootenv.var.colorattribute”
./vendor/amlogic/frameworks/services/systemcontrol/DisplayMode.cpp
strcpy(colorAttribute, “444,12bit”);
//save to ubootenv
saveDeepColorAttr(outputmode, colorAttribute);
setBootEnv(UBOOTENV_COLORATTRIBUTE, colorAttribute); //设置环境变量 colorattribute 值为444,12bit
get看一下环境变量的属性:
gtt92e:/ $ getprop | grep colorattribute
[ubootenv.var.colorattribute]: [444,12bit]
导致在下次开机uboot的时候会get到这个环境变量值:
./uboot/common/cmd_hdmitx.c
if (getenv(“colorattribute”)){
hdmi_parse_attr(hdmitx_device.para, getenv(“colorattribute”)); //打印出来为444,12bit
}
然后在 hdmi_parse_attr函数[文件:common/hdmi_parameters.c] 会默认把hdmi tx的output_color_format设置为1,即
(在hdmi_parse_attr会设置色深(color depth:8bit,10bit,12bit等),彩色空间(color space:rgb,444,422等)等参数)
void hdmi_parse_attr(struct hdmi_format_para *para, char const *name)
{
...
/* parse color space */
for (i = 0; i < sizeof(parse_cs_) / sizeof(struct parse_cs); i++) {
if (strstr(name, parse_cs_[i].name)) {
para->cs = parse_cs_[i].cs;
break;
}
}
/* set default value */
if (i == sizeof(parse_cs_) / sizeof(struct parse_cs)){
para->cs = HDMI_COLOR_FORMAT_444;
}
...
}
导致出现花屏问题。究其原因是有些屏不支持444,12bit的颜色格式显示所致。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
解决方案:目前的解决办法是:
1、在uboot不去get这个环境变量getenv(“colorattribute”),即把这部分代码注释掉或者if 0让它不执行。
2、强制不让它设置这个hdmi tx的颜色格式参数。
解决方案1:
czd@ubt144c:/work/czd/amlogic_7.1/uboot$ git diff
diff --git a/common/cmd_hdmitx.c b/common/cmd_hdmitx.c
index 7166b8f…3899f82 100644
— a/common/cmd_hdmitx.c
+++ b/common/cmd_hdmitx.c
@@ -207,8 +207,13 @@ static int do_output(cmd_tbl_t *cmdtp, int flag, int argc, char const argv[])
printf(“set hdmitx VIC = %d\n”, hdmitx_device.vic);
if (strstr(argv[1], “hz420”) != NULL)
hdmitx_device.para->cs = HDMI_COLOR_FORMAT_420;
+/ rm by czd for UEI hdmi tx /
+#if 0
if (getenv(“colorattribute”))
hdmi_parse_attr(hdmitx_device.para, getenv(“colorattribute”));
+#endif
+/ rm end /
+
/ For RGB444 or YCbCr444 under 6Gbps mode, no deepcolor /
/ Only 4k50/60 has 420 modes */
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
解决方案2:在hdmi_parse_attr接口函数把para->cs的参数写死为2,即设置为 HDMI_COLOR_FORMAT_422,(HDMI_COLOR_FORMAT_422在./include/amlogic/hdmi.h宏定义);
或者在config_hdmi20_tx处直接把hdev->para->cs参数设置为2,即修改如下:
// --------------------------------------------------------
// Set up HDMI
// --------------------------------------------------------
config_hdmi20_tx(hdev->vic, para, // pixel_repeat,
hdev->para->cd, // Pixel bit width: 4=24-bit; 5=30-bit; 6=36-bit; 7=48-bit.
TX_INPUT_COLOR_FORMAT, // input_color_format: 0=RGB444; 1=YCbCr422; 2=YCbCr444; 3=YCbCr420.
TX_INPUT_COLOR_RANGE, // input_color_range: 0=limited; 1=full.
hdev->para->cs = 2, // output_color_format: 0=RGB444; 1=YCbCr422; 2=YCbCr444; 3=YCbCr420.
TX_OUTPUT_COLOR_RANGE // output_color_range: 0=limited; 1=full.
);
1
2
3
4
5
6
7
8
9
10
11
12
amlogic android7.1 HDMI显示的设置流程分析:
uboot目录:
涉及文件目录:
amlogic【目录】
./board/amlogic/txlx_gtt92e_v1/txlx_gtt92e_v1.c【board的一些初始化,上电之类的】
./board/amlogic/configs/txlx_gtt92e_v1.h【配置环境变量和相关的宏控】
common【目录】
./common/cmd_osd.c
./common/cmd_hdmitx.c
./common/hdmi_parameters.c
display【目录】
./drivers/display/osd/osd_fb.c
./drivers/display/vout/vout.c
hdmitx20【目录】
./arch/arm/cpu/armv8/txlx/hdmitx20/hdmitx_set.c
./arch/arm/cpu/armv8/txlx/hdmitx20/hdmitx_tvenc.c
配置宏CONFIG_AML_HDMITX20,打开hdmitx的相关功能,编译对应的.c文件【如果后续需要添加别的宏控可以添加到这个文件】。
在文件:board/amlogic/configs/txlx_gtt92e_v1.h中添加如下代码:
/* DISPLAY & HDMITX */
#define CONFIG_AML_HDMITX20 1
outputmode的环境变量参数设置,例如配置为:outputmode=1080p60hz, 如果没有设置则会load默认的env。
文件:board/amlogic/configs/txlx_gtt92e_v1.h
||
||
\/
1、文件:board/amlogic/txlx_gtt92e_v1/txlx_gtt92e_v1.c
->hdmi_tx_init();
2、文件./common/cmd_osd.c
->U_BOOT_CMD_MKENT(open, 2, 0, do_osd_open, “”, “”)
->do_osd_open
->video_hw_init();
||
/
3、文件./drivers/display/osd/osd_fb.c
->video_hw_init; //硬件初始化
->vout_init();
||
\/
-----------------------------------------
4、文件.drivers/display/vout/vout.c
->vout_init();
->vout_vmode_init(); //显示分辨率初始化
->outputmode = getenv("outputmode"); //获取outputmode的环境变量参数,例如UEI的配置为:outputmode is 1080p60hz,board/amlogic/configs/txlx_gtt92e_v1.h中设置
->vmode = vout_find_mode_by_name(outputmode); //获取outputmode的环境变量配置的分辨率mode值
-> mode = vout_sets[i].mode;
->vout_set_current_vmode(vmode); //设置当前分辨率mode
->width = vout_find_width_by_name(outputmode); //获取分辨率mode的宽度值
->height = vout_find_height_by_name(outputmode); //获取分辨率mode的高度值
->field_height = vout_find_field_height_by_name(outputmode); //获取分辨率mode的场高度
->vout_reg_write(VPP_POSTBLEND_H_SIZE, width); //寄存器写入值设置对应宽度值参数
->vout_axis_init(width, height); //初始化宽度和高度值
->vout_vinfo_init(width, height, field_height); //
-----------------------------------------
||
\/
5、文件./drivers/display/osd/osd_fb.c
->fb_addr = get_fb_addr();
->parent_offset = fdt_path_offset(dt_addr, “/meson-fb”);
->fb_addr = simple_strtoul(propdata, NULL, 16);
6、文件:./common/cmd_hdmitx.c
->do_hdmitx
->find_cmd_tbl(argv[0], &cmd_hdmi_sub[0], ARRAY_SIZE(cmd_hdmi_sub));
->cmd_hdmi_sub
->do_output(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]); //设置输出
->hdmitx_device.vic = hdmi_get_fmt_vic(argv[1]); //###这里获取vic的值###,VIC值定义在./uboot/include/amlogic/hdmi.h中。
->hdmi_parse_attr(para, name); //根据name的索引,在all_fmt_paras中查找对应的颜色深度和彩色空间,如果无该属性值,则按照默认设置处理
->if (strstr(name, parse_cs_[i].name)) {
para->cs = parse_cs_[i].cs;//从"hdmitx output FORMAT"解析字符串,包括颜色深度和彩色空间
->hdmitx_device.para = hdmi_get_fmt_paras(hdmitx_device.vic);==== ||获取设备的hdmi显示参数值,在./common/hdmi_parameters.c中
->if (getenv("colorattribute")) //如果有环境变量值设置,获取环境变量值colorattribute,该属性值在开机起来之后会在上层有设置
hdmi_parse_attr(hdmitx_device.para, getenv("colorattribute")); || //代码在endor/amlogic/frameworks/services/systemcontrol/DisplayMode.cpp
->do_edid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]); || //###读取EDID数据,这里实际没有调用到###
|/* current only support read 1 byte edid data */
->|hdmitx_device.HWOp.read_edid() [文件:arch/arm/cpu/armv8/txlx/hdmitx20/hdmitx_set.c]
->hdmitx_read_edid;
->read_edid_8bytes(buf, addr);
||
\/
->hdmi_tx_set(&hdmitx_device);
---------------------------------------------------------------------------------||------------------
-> 7、文件:arch/arm/cpu/armv8/txlx/hdmitx20/hdmitx_set.c ||
->hdmi_tx_set(struct hdmitx_dev *hdev); ||
->hdmitx_hw_init(); //hdmi tx初始化 ||
->hdmitx_debug(); ||
->ddc_init(); ||
->ddc_pinmux_init(); ||
->hdmitx_set_hw(hdev); //hdmi tx设置硬件参数 ||
->hdmitx_debug(); ||
->para = hdmi_get_fmt_paras(hdev->vic); //根据vic值获取hdmi格式参数 ||
|| ||
\/ ||
---------------------------------------------------------------------------------\/-------------------
8、文件:./common/hdmi_parameters.c
->hdmi_get_fmt_paras
->for (i = 0; all_fmt_paras[i] != NULL; i++) { //####这里根据vic值与all_fmt_paras[i]->vic比对,去遍历查找all_fmt_paras结构体中对应的hdmi显示相关参数值####
if (vic == all_fmt_paras[i]->vic)
return all_fmt_paras[i];
->static struct hdmi_format_para *all_fmt_paras[] = {
...
&fmt_para_1920x1080p60_16x9, //例如 fmt_para_1920x1080p60_16x9:相关的clk设置,前后阶参数就在结构体fmt_para_1920x1080p60_16x9中
...
}
||
||
||
--------------------\||/----------
---------------------\/---------
5 static struct hdmi_format_para fmt_para_1920x1080p60_16x9 = {
6 .vic = HDMI_1920x1080p60_16x9,
7 .name = “1920x1080p60hz”,
8 .sname = “1080p60hz”,
9 .pixel_repetition_factor = 0,
10 .progress_mode = 1,
11 .scrambler_en = 0,
12 .tmds_clk_div40 = 0,
13 .tmds_clk = 148500,
14 .timing = {
15 .pixel_freq = 148500,
16 .h_freq = 67500,
17 .v_freq = 60000,
18 .vsync_polarity = 1,
19 .hsync_polarity = 1,
20 .h_active = 1920,
21 .h_total = 2200,
22 .h_blank = 280,
23 .h_front = 88,
24 .h_sync = 44,
25 .h_back = 148,
26 .v_active = 1080,
27 .v_total = 1125,
28 .v_blank = 45,
29 .v_front = 4,
30 .v_sync = 5,
31 .v_back = 36,
32 .v_sync_ln = 1,
33 },
34 };
||
/
-----------------------------------------------------------------------
***********************************************************************
->hdmitx_set_pll(hdev); //设置hdmi tx pll分频
->set_hdmitx_clk(hdev->vic); //设置tx clk
->hdmitx_set_phy(hdev); //设置hdmi tx phy,phy为端口物理层
->set_phy_by_mode; //根据分辨率设置phy的数据传输速率
->hdmitx_enc(hdev->vic); //为HDMI设置编码器
\/ ->set_vmode_enc_hw(vic);
|| ->hdmi_tvenc_set(vic); //#############根据vic值选择不同的编码参数设置##############
||==\\ ->hdmi_tvenc_set;
|| ->default:
|| hdmi_tvenc_set_def(vic); //如果没有匹配的vic值,则设置默认编码参数
|| ||
|| \/
*||*********************************************************************
------------------------------------------------------------------------
||
\/
--------------------------------------------------------
9、文件:arch/arm/cpu/armv8/txlx/hdmitx20/hdmitx_tvenc.c
->set_vmode_enc_hw(enum hdmi_vic vic);
->tvregs_setting_mode(vic); //以vic作为索引返回tvregsTab的对应reg_setting,reg_setting就是对应的hdmi参数设置结构体:第一个参数是寄存器,第二个参数是要设置值
->for (i = 0; i < ARRAY_SIZE(tvregsTab); i++) {
if (vic == tvregsTab[i].vic)
return tvregsTab[i].reg_setting;
->setreg(s++); \\###############{ 根据vic得到的参数结构体设置寄存器的值 }#############
->hd_write_reg(r->reg, r->val); //根据reg_setting设置对应寄存器的值
--------------------------------------------------------
->hdmitx_set_vdac(0);
->config_hdmi20_tx //设置HDMI up
||
\/
**************************************
2274 // --------------------------------------------------------
2275 // Set up HDMI
2276 // --------------------------------------------------------
2277 config_hdmi20_tx(hdev->vic, para, // pixel_repeat,
2278 hdev->para->cd, // Pixel bit width: 4=24-bit; 5=30-bit; 6=36-bit; 7=48-bit.
2279 TX_INPUT_COLOR_FORMAT, // input_color_format: 0=RGB444; 1=YCbCr422; 2=YCbCr444; 3=YCbCr420.
2280 TX_INPUT_COLOR_RANGE, // input_color_range: 0=limited; 1=full.
2281 hdev->para->cs, // output_color_format: 0=RGB444; 1=YCbCr422; 2=YCbCr444; 3=YCbCr420.
2282 TX_OUTPUT_COLOR_RANGE // output_color_range: 0=limited; 1=full.
2283 );
**************************************
->hdmitx_hw_init(); //启动时钟并解除复位,还有一些硬件的初始化工作
->hd_set_reg_bits //通过设置寄存器实现
->save_hdmitx_format(hdev->vic, (hdev->para->cs == HDMI_COLOR_FORMAT_420));
->save_hdmitx_format(enum hdmi_vic vic, int y420)//
->hd_write_reg(P_ISA_DEBUG_REG0, data32);// ############## 写入hdmi tx format参数 #################
->hdmitx_debug();
10、文件:./uboot/arch/arm/cpu/armv8/txlx/hdmitx20/hdmitx_set.c
->scdc_prepare(unsigned int div
->scdc_rd_sink(SINK_VER, &rx_ver); //这里判断是接的是1.4还是2.0版本的hdmi接口,(rx_ver == 1) ? "2.0" : "1.4 or below",通过读取寄存器值判断是接入什么接口hdmi
->scdc_wr_sink(unsigned char adr, unsigned char val);
->{
hdmitx_wr_reg(HDMITX_DWC_I2CM_SLAVE, 0x54);
hdmitx_wr_reg(HDMITX_DWC_I2CM_ADDRESS, adr);
hdmitx_wr_reg(HDMITX_DWC_I2CM_DATAO, val);
hdmitx_wr_reg(HDMITX_DWC_I2CM_OPERATION, 0x10);
}
common目录即(kernel部分):
驱动目录:
drivers/amlogic/hdmi/hdmi_tx_20/
文件:drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c
->amhdmitx_probe //从跑probe开始分析
->INIT_DELAYED_WORK(&hdmi_delay_event_work, hdmi_delay_event_post); //初始化延时工作队列,
->hdmitx_init_parameters(&hdmitx_device.hdmi_info); //hdmitx协议级接口; 在文件:./drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_video.c
->
->HDMITX_Meson_Init(&hdmitx_device); //HDMI TX初始化
->hdmi_hwp_init(hdev);
->hdmitx_uboot_already_display() // 文件:./drivers/amlogic/hdmi/hdmi_tx_20/hw/hdmi_tx_hw.c
->get_hdmitx_format(); //获取记录HDMI TX当前hdmitx format参数,与uboot匹配(通过下面的读取寄存器值的方式)
->return hd_read_reg(P_ISA_DEBUG_REG0); //读取寄存器 P_ISA_DEBUG_REG0 的值,这个寄存器值在uboot中设置
/* ISA_DEBUG_REG0 0x2600 //VIC值在./include/linux/amlogic/hdmi_tx/hdmi_common.h有枚举定义
* bit[11]: Y420
* bit[10:8]: HDMI VIC //这里 #######获取VIC值#########,
* bit[7:0]: CEA VIC
*/
->hdmitx_init_fmt_attr(&hdmitx_device, fmt_attr);// ############ 设置当前color format ###########
->memcpy(fmt_attr, "422,", 4); //例如
->strcat(fmt_attr, "10bit"); //例如
->hdmitx_device.task = kthread_run(hdmi_task_handle, &hdmitx_device, "kthread_hdmi"); //kthread_run创建和运行内核线程,入口函数是 hdmi_task_handle
->hdmi_task_handle
->switch_set_state(&hdmi_power, hdmitx_device->hpd_state);//设置hdmi拔插状态
->INIT_WORK(&hdmitx_device->work_hdr, hdr_work_func); //初始化hdmi状态检测工作队列hdr_work_func
->hdr_work_func
->hdmitx_sdr_hdr_uevent(hdev); //hdmi拔插检测的uevent事件
->switch_set_state(&hdmi_hdr, 1); //插入hdmi?
->switch_set_state(&hdmi_hdr, 0); //拔出hdmi?
->hdmitx_edid_ram_buffer_clear(hdmitx_device); //初始化hdmi时,清除hdmitx模块edid ram和edid缓冲区
->INIT_DELAYED_WORK(&hdmitx_device->work_hpd_plugin, hdmitx_hpd_plugin_handler); //初始化延时工作队列hdmitx_hpd_plugin_handler,检测hdmi插入
->INIT_DELAYED_WORK(&hdmitx_device->work_hpd_plugout, hdmitx_hpd_plugout_handler); //初始化延时工作队列hdmitx_hpd_plugout_handler,检测hdmi拔出
->void hdmitx_hpd_plugin_handler(struct work_struct *work); //延时工作队列函数
->if (hdev->repeater_tx) //判断hdmi是否插入,设置hpd状态
rx_repeat_hpd_state(1); //设置hpd状态为插入hdmi
->hdmitx_get_edid(hdev); //获取EDID信息: 这里通过i2c通讯的方式读取edid,读取128个字节,这里读取两次,
|| ->gpio_read_edid(hdev->EDID_buf);
->edid_rx_data(regaddr & 0xff, rx_data, 128); //读取128个字节的edid
->err = i2c_transfer(i2c_edid_client->adapter, msgs, ARRAY_SIZE(msgs));
||调用
\/
------------------------------------------------------------
文件./drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_edid.c
->hdmitx_edid_clear(hdev); //清除HDMI Sink的EDID的解析结果,原函数在文件./drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_edid.c中
->hdmitx_edid_parse(hdev); //解析读到的edid的内容--【128个字节】,
->ret_val = Edid_DecodeHeader(&hdmitx_device->hdmi_info, &EDID_buf[0]); //判断edid的引导码是否正确,一般是:00ffffffffffff00开头的引导码
->如果识别到的edid块数量为0,则 #################识别读取不到显示器edid####################
->if (BlockCount == 0) {
->hdmitx_edid_set_default_vic(hdmitx_device); //设置默认的vic值
->
}
->hdmitx_edid_block_parse(hdmitx_device, &(EDID_buf[i*128])); //
->Edid_DTD_parsing(struct rx_cap *pRXCap, unsigned char *data); //EDID DTD 详细时序解析
->para = hdmi_match_dtd_paras(t); //调用 hdmi_match_dtd_paras()检查t时序参数是否与VIC对应时序参数匹配
||
\/
文件:./drivers/amlogic/hdmi/hdmi_common/hdmi_parameters.c
->*hdmi_match_dtd_paras(struct dtd *t) //这里hdmi_match_dtd_paras函数的t参数会和all_fmt_paras对应的参数比对,如果一致就返回对应参数对应结构体
->return all_fmt_paras[i]; \/
->struct hdmi_format_para *all_fmt_paras[] = { //hdmi的显示参数结构体,分辨率、clk和前后阶参数等都在这里
...
&fmt_para_3840x2160p60_16x9,
...
}
||
\/
static struct hdmi_format_para fmt_para_3840x2160p60_16x9 = {
.vic = HDMI_3840x2160p60_16x9,
.name = "3840x2160p60hz",
.sname = "2160p60hz",
.pixel_repetition_factor = 0,
.progress_mode = 1,
.scrambler_en = 1,
.tmds_clk_div40 = 1,
.tmds_clk = 594000,
.timing = {
.pixel_freq = 594000,
.frac_freq = 593407,
.h_freq = 135000,
.v_freq = 60000,
.vsync_polarity = 1,
.hsync_polarity = 1,
.h_active = 3840,
.h_total = 4400,
.h_blank = 560,
.h_front = 176,
.h_sync = 88,
.h_back = 296,
.v_active = 2160,
.v_total = 2250,
.v_blank = 90,
.v_front = 8,
.v_sync = 10,
.v_back = 72,
.v_sync_ln = 1,
},
};
->dump_dtd_info(t); //dump出hdmi的显示参数
------------------------------------------------------------
->set_disp_mode_auto(); //###########设置显示分辨率##############
->hdmi_get_current_vinfo
->info = get_current_vinfo();
->vinfo_s *get_current_vinfo(void)
->return &vinfo_1080p60hz; //这里分辨率设置为1080p60hz
-> ||
\/
-----------------------------
104 const struct vinfo_s vinfo_1080p60hz = {
105 .name = "1080p60hz",
106 .mode = VMODE_1080P,
107 .width = 1920,
108 .height = 1080,
109 .field_height = 1080,
110 .aspect_ratio_num = 16,
111 .aspect_ratio_den = 9,
112 .sync_duration_num = 60,
113 .sync_duration_den = 1,
114 .video_clk = 148500000,
115 };
-----------------------------
->hdmitx_edid_buf_compare_print(hdev); //打印edid buf内容到log输出
||
\/
---------------------------------------
文件:./drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_edid.c
->hdmitx_edid_buf_compare_print(struct hdmitx_dev *hdmitx_device) //假设DDC成功读取EDID两次,然后比较EDID_buf和EDID_buf1。如果相同,
//只打印出EDID buf原始数据,否则打印出2个缓冲区数据
->for (blk_idx = 0; blk_idx < valid_blk_no; blk_idx++)
hdmitx_edid_blk_print(&buf0[blk_idx*128], blk_idx);
->valid_blk_no = hdmitx_edid_check_valid_blocks(buf1);
for (blk_idx = 0; blk_idx < valid_blk_no; blk_idx++)
hdmitx_edid_blk_print(&buf1[blk_idx*128], blk_idx);
---------------------------------------
||
\/
->set_disp_mode_auto(); //
->hdmi_get_current_vinfo();//获取当前显示信息
->para = hdmi_get_fmt_name(mode, fmt_attr); //
->vic = hdmitx_edid_get_VIC(hdev, mode, 1); //
->ret = hdmitx_set_display(hdev, vic); //
->recalc_vinfo_sync_duration(info, hdev->frac_rate_policy);
->hdmitx_set_audio(hdev, &(hdev->cur_audio_param), hdmi_ch); //打开hdmi音频
相关文件节点目录:./drivers/amlogic/display/vout/vout_serve.c
相关节点:
1|stvs9:/ # ls -l ./sys/devices/virtual/amhdmitx/amhdmitx0/
total 0
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 attr
-r–r–r-- 1 root root 4096 2020-04-30 10:36 aud_cap
-rw-rw-r-- 1 system mediadrm 4096 2020-04-30 10:36 aud_ch
-rw-r–r-- 1 root root 4096 2020-04-30 10:36 aud_mode
-rw-r–r-- 1 root root 4096 2020-04-30 10:36 aud_mute
-rw-rw-r-- 1 system mediadrm 4096 2020-04-30 10:36 aud_output_chs
-rw-r–r-- 1 system system 4096 2020-04-30 10:36 avmute
-r–r–r-- 1 root root 4096 2020-04-30 10:36 cea_cap
-rw-rw-rw- 1 system system 4096 2020-04-30 10:36 config
-r–r–r-- 1 root root 4096 2020-04-30 10:36 dc_cap
–w------- 1 root root 4096 2020-04-30 10:36 debug
-r–r–r-- 1 root root 4096 2020-04-30 10:36 dev
-r–r–r-- 1 root root 4096 2020-04-30 10:36 disp_cap
-r–r–r-- 1 root root 4096 2020-04-30 10:36 disp_cap_3d
-rw-rw-r-- 1 system system 4096 2020-04-30 10:36 disp_mode
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 div40
-r–r–r-- 1 root root 4096 2020-04-30 10:36 dv_cap
-rw-r–r-- 1 root root 4096 2020-04-30 10:36 edid
-r–r–r-- 1 root root 4096 2020-04-30 10:36 edid_parsing
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 frac_rate_policy
-r–r–r-- 1 root root 4096 2020-04-30 10:36 hdcp22_base
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 hdcp22_type
–w------- 1 root root 4096 2020-04-30 10:36 hdcp_byp
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 hdcp_clkdis
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 hdcp_ctrl
-r–r–r-- 1 root root 4096 2020-04-30 10:36 hdcp_ksv_info
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 hdcp_lstore
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 hdcp_mode
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 hdcp_pwr
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 hdcp_repeater
-r–r–r-- 1 root root 4096 2020-04-30 10:36 hdcp_ver
-r–r–r-- 1 root root 4096 2020-04-30 10:36 hdmi_init
-r–r–r-- 1 root root 4096 2020-04-30 10:36 hdr_cap
-r–r–r-- 1 system system 4096 2020-04-30 10:36 hpd_state
-rw-rw-rw- 1 root root 4096 2020-04-30 10:36 phy
drwxr-xr-x 2 root root 0 2020-04-30 10:36 power
-r–r–r-- 1 root root 4096 2020-04-30 10:36 preferred_mode
-r–r–r-- 1 root root 4096 2020-04-30 10:36 rawedid
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 ready
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 rxsense_policy
–w–w---- 1 root root 4096 2020-04-30 10:36 sdr_hdr
-r–r–r-- 1 root root 4096 2020-04-30 10:36 sink_type
lrwxrwxrwx 1 root root 0 2020-04-30 10:36 subsystem -> …/…/…/…/class/amhdmitx
-r–r–r-- 1 root root 4096 2020-04-30 10:36 support_3d
-rw-r–r-- 1 root root 4096 2020-04-30 10:36 uevent
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 valid_mode
-r–r–r-- 1 root root 4096 2020-04-30 10:36 vesa_cap
-rw-rw-r-- 1 root root 4096 2020-04-30 10:36 vic
-rw-r–r-- 1 root root 4096 2020-04-30 10:36 vid_mute
130|stvs9:/ # ls -l ./sys/class/display/
total 0
-rw-r–r-- 1 media system 4096 2020-04-30 10:36 axis
lrwxrwxrwx 1 root root 0 2020-04-30 10:37 display -> …/…/devices/virtual/display/display
-rw-r–r-- 1 root root 4096 2020-04-30 10:37 fr_policy
-rw-r–r-- 1 system system 4096 2020-04-30 10:36 mode
-rw-rw-r-- 1 root root 4096 2020-04-30 10:37 vinfo
1
2
3
4
5
6
7
1、读取edid原始数据:
stvs9:/ # cat ./sys/devices/virtual/amhdmitx/amhdmitx0/rawedid
00ffffffffffff0025e4032301010101011d0103805022782a96a1a355539f250a5054210800818081c0a9c0d1c001010101010101014eab70b8d1a042509060640820
4f3100001a000000fd00174c1f703c000a202020202020000000ff0053657269616c4e756d6265720a000000fc004c43442d474357513334315844015802033d704b10
0102030405202256585a23090707830100006a030c002000383c20000067d85dc401788001e30f0004e200cae60607018b6011e3056000e77c70a0d0a0295030203a00
204f3100001a565e00a0a0a0295030203500204f3100001a295900a0a038274030203a00204f3100001a000000000000000000000000ea
2、设置分辨率
stvs9:/ # echo 1080p60hz > sys/class/display/mode //设置分辨率为1080p
stvs9:/ # cat sys/class/display/mode //查看当前设备分辨率
1080p60hz
3、RX所支持的色彩空间/色深模式支持的情况
stvs9:/ $ cat /sys/class/amhdmitx/amhdmitx0/dc_cap
420,10bit
420,8bit
444,12bit
444,10bit
444,8bit
422,12bit
422,10bit
422,8bit
rgb,12bit
rgb,10bit
rgb,8bit
4、RX所支持的HDMI显示模式支持的情况
stvs9:/ $ cat /sys/class/amhdmitx/amhdmitx0/disp_cap
480p60hz
720p60hz
1080i60hz
1080p60hz
1080p30hz
1080p24hz
————————————————
版权声明:本文为CSDN博主「平仄散人」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_30624591/article/details/103645940