我需要制作一个 800x600 的固定频率屏幕,屏幕在 imx6 中使用 LVDS 接口效果很好,现在我需要使用 hdmi 接口移植到 imx8mq。
我参考了这个
Driving a 1080x1920 portrait HDMI screen solu
tion。
所以我的解决方案是:
1. 在 drivers/gpu/drm/imx/hdp/imx-hdp.c 中添加以下 drm 模式
{drm_mode(“ 800x600”,drm_mode_type_driver,40000,800,840,840,850,950,0,600,600,600,603,605,635,0,
drm_mode_flag_flag_phsync
| drm_mode_flag_phag_pvsync
)
2.取消drivers/gpu/drm/imx/hdp/t28hpc_hdmitx_table.c中(VESA pixel clock rate support in debugging)部分的注释
/* Table 8. HDMI TX clock control settings (pixel clock is output) */
const u32 t28hpc_hdmitx_clock_control_table_pixel_out[T28HPC_HDMITX_CLOCK_CONTROL_TABLE_ROWS_PIXEL_OUT][T28HPC_HDMITX_CLOCK_CONTROL_TABLE_COLS_PIXEL_OUT] = {
{ 27000, 1000, 270000, 0x03, 0x1, 0x1, 240, 0x0BC, 0x030, 80, 0x026, 0x026, 2160000, 0, 2, 2, 2, 4, 135000, 0x3, 27000, 1}, { 27000, 1250, 337500, 0x03, 0x1, 0x1, 300, 0x0EC, 0x03C, 100, 0x030, 0x030, 0x030,
0x03 2700000, 0, 2, 2, 2, 4, 168750, 0x3, 33750, 1}, {
27000, 1500, 405000, 0x03, 0x1, 0x1, 360, 0x11C, 0x048, 120, 0x03A, 0x040A, 32 0,0 2, 2, 2, 4, 202500, 0x3, 40500, 1},
{ 27000, 2000, 540000, 0x03, 0x1, 0x1, 240, 0x0BC, 0x030, 80, 0x026, 0x026, 2160000, 0, 2, 2, 2 2, 4, 270000, 0x2, 54000, 1},
{ 54000, 1000, 540000, 0x03, 0x1, 0x1, 480, 0x17C, 0x060, 80, 0x026, 0x026, 4320000, 1, 2, 2, 2, 4, 270000, 0x3, 54000, 1}0, { 5125, {
5125 , 675000, 0x04, 0x1, 0x1, 400, 0x13C, 0x050, 50, 0x017, 0x017, 2700000, 0, 1, 1, 2, 4, 337500, 0x2, 67500, 1}, { 54000, 15000, 8 0x00,
8 , 0x1, 0x1, 480, 0x17C, 0x060, 60, 0x01C, 0x01C, 3240000, 0, 2, 2, 2, 2, 405000, 0x2, 81000, 1}, { 54000, 2000, 1080000, 0x1,03,
0 , 240, 0x0BC, 0x030, 40, 0x012, 0x012, 2160000, 0, 2, 2, 2, 1, 540000, 0x1, 108000, 1}, { 74250, 1000, 742500, 0x03, 0x1, 620, 0x1,
6 , 0x084, 80, 0x026, 0x026, 5940000, 1, 2, 2, 2, 4, 371250, 0x3, 74250, 1}, { 74250, 1250, 928125, 0x04, 0x1, 0x1, 550, 0x1B4,
50 , 0x017, 0x017, 3712500, 1, 1, 1, 2, 4, 464062, 0x2, 92812, 1},
{ 74250, 1500, 1113750, 0x04, 0x1, 0x1, 660, 0x20C, 0x084, 60, 0x01C, 0x01C, 4455000, 1, 2, 2, 2, 2, 556875, 0x2, 111375, 7 205}, {
0 , 1485000, 0x03, 0x1, 0x1, 330, 0x104, 0x042, 40, 0x012, 0x012, 2970000, 0, 2, 2, 2, 1, 742500, 0x1, 148500, 1}, { 99000, 90x00, 90x00
, , 0x1, 0x1, 440, 0x15C, 0x058, 40, 0x012, 0x012, 3960000, 1, 2, 2, 2, 2, 495000, 0x2, 99000, 1}, { 99000, 1250, 1237500, 0x1, 0x1,
0 , 275, 0x0D8, 0x037, 25, 0x00B, 0x00A, 2475000, 0, 1, 1, 2, 2, 618750, 0x1, 123750, 1}, { 99000, 1500, 1485000, 0x03, 0x1, 30x1,
30x1 , 0x042, 30, 0x00D, 0x00D, 2970000, 0, 2, 2, 2, 1, 742500, 0x1, 148500, 1}, { 99000, 2000, 1980000, 0x03, 0x1, 0x1, 440, 0x05C,
0x05C , 0x012, 0x012, 3960000, 1, 2, 2, 2, 1, 990000, 0x1, 198000, 1},
{148500, 1000, 1485000, 0x03, 0x1, 0x1, 660, 0x20C, 0x084, 40, 0x012, 0x012, 5940000, 1, 2, 2, 2, 2, 742500, 0x2, 148500, 180, 25}, {
0,0 、1856250、0x04、0x1、0x1、550、0x1B4、0x06E、25、0x00B、0x00A、3712500、1、1、1、2、2、928125、0x1、185625、1}、{
148500、03、2505x , 0x1, 0x1, 495, 0x188, 0x063, 30, 0x00D, 0x00D, 4455000, 1, 1, 1, 2, 2, 1113750, 0x1, 222750, 1}, {148500, 2000, 2970000, 0x1,
0x03 , 660, 0x20C, 0x084, 40, 0x012, 0x012, 5940000, 1, 2, 2, 2, 1, 1485000, 0x1, 297000, 1}, {198000, 1000, 1980000, 0x03, 0x12, 0AC0,
0x , 0x02C, 10, 0x003, 0x003, 1980000, 0, 1, 1, 2, 1, 990000, 0x0, 198000, 1}, {198000, 1250, 2475000, 0x03, 0x1, 0x1, 550, 0x1B4,
0x1B4 , 0x00B, 0x00A, 4950000, 1, 1, 1, 2, 2, 1237500, 0x1, 247500, 1},
{198000, 1500, 2970000, 0x03, 0x1, 0x1, 330, 0x104, 0x042, 15, 0x006, 0x005, 2970000, 0, 1, 1, 2, 1, 1485000, 0x0, 297000,9 2000 {0}, 297000, 2800
, , 3960000, 0x03, 0x1, 0x1, 440, 0x15C, 0x058, 20, 0x008, 0x008, 3960000, 1, 1, 1, 2, 1, 1980000, 0x0, 396000, 1}, {297000, 03,1000,
03,1000 , 0x1, 0x1, 330, 0x104, 0x042, 10, 0x003, 0x003, 2970000, 0, 1, 1, 2, 1, 1485000, 0x0, 297000, 1}, {297000, 1500, 4455000, 0x1,
0x03 , 495, 0x188, 0x063, 15, 0x006, 0x005, 4455000, 1, 1, 1, 2, 1, 2227500, 0x0, 445500, 1}, {297000, 2000, 5940000, 0x03, 0x1, 0x12,
600x , 0x084, 20, 0x008, 0x008, 5940000, 1, 1, 1, 2, 1, 2970000, 0x0, 594000, 1}, {594000, 1000, 5940000, 0x03, 0x1, 0x1, 660C, 0x08,
0x20 , 0x003, 0x003, 5940000, 1, 1, 1, 2, 1, 2970000, 0x0, 594000, 1},
{594000, 750, 4455000, 0x03, 0x1, 0x1, 495, 0x188, 0x063, 10, 0x003, 0x003, 4455000, 1, 1, 1, 2, 1, 2227500, 0x0, 6455059, 40, {0},
{ , 3712500, 0x04, 0x1, 0x1, 550, 0x1B4, 0x06E, 10, 0x003, 0x003, 3712500, 1, 1, 1, 2, 1, 1856250, 0x0, 371250, 0}, {594000,03, 9500,
7000 , 0x1, 0x1, 660, 0x20C, 0x084, 10, 0x003, 0x003, 5940000, 1, 1, 1, 2, 2, 1485000, 0x1, 297000, 1}, #if 1 /* VESA 像素时钟速率支持
调试*/
{ 40000, 1000, 400275, 0x05, 0x1, 0x1, 593, 0x126, 0x127, 80, 0x026, 0x026, 3202200, 1, 1, 1, 1, 1, 200137, 0x3, 40027, 4 01}, {
0 , 1250, 500175, 0x05, 0x1, 0x1, 741, 0x170, 0x171, 100, 0x030, 0x030, 4001400, 1, 1, 1, 1, 1, 250087, 0x3, 50017, 1},
{ 40000, 1500, 600075, 0x05, 0x1, 0x1, 889, 0x1BA, 0x1BB, 120, 0x03A, 0x03A, 4800600, 1, 1, 1, 1, 1, 300037, 0x3, 60007, 1}, { 42000, {
42000 , 800550, 0x05, 0x1, 0x1, 593, 0x126, 0x127, 80, 0x026, 0x026, 3202200, 1, 1, 1, 1, 1, 400275, 0x2, 80055, 1}, { 65000, 5005,
6 , 0x1, 0x1, 963, 0x1DF, 0x1E0, 80, 0x026, 0x026, 5200200, 1, 1, 1, 1, 1, 325012, 0x3, 65002, 1}, { 65000, 1250, 812700, 0x05,
0x1x , 602, 0x12B, 0x12B, 50, 0x017, 0x017, 3250800, 1, 1, 1, 1, 1, 406350, 0x2, 81270, 1}, { 65000, 1500, 974700, 0x05, 0x1, 0x1, 2x1,
0 ,0x167,60,0x01C,0x01C,3898800,1,1,1,1,1,487350,0x2,97470,1},{65000,2000,1300050,0x05,0x1,0x1,963,0x11EDF,0x11EDF,0x11EDF,
0 , 0x026, 0x026, 5200200, 1, 1, 1, 1, 1, 650025, 0x2, 130005, 1},
{108000, 1000, 1080000, 0x05, 0x1, 0x1, 800, 0x18E, 0x18E, 40, 0x012, 0x012, 4320000, 1, 1, 1, 1, 1, 540000, 0x2, 108000, 10, 20}, {
0,0 , 1350000, 0x05, 0x1, 0x1, 1000, 0x1F2, 0x1F2, 50, 0x017, 0x017, 5400000, 1, 1, 1, 1, 1, 675000, 0x2, 135000, 1}, {108000, 0,16200,
0,15000 , 0x1, 0x1, 600, 0x12A, 0x12A, 30, 0x00D, 0x00D, 3240000, 1, 1, 1, 1, 1, 810000, 0x1, 162000, 1}, {108000, 2000, 2160000,
0x1,0x05 , 800, 0x18E, 0x18E, 40, 0x012, 0x012, 4320000, 1, 1, 1, 1, 1, 1080000, 0x1, 216000, 1}, {154000, 1000, 1539000, 0x05, 0x1, 1, 1B,
700x , 0x11B, 20, 0x008, 0x008, 3078000, 1, 1, 1, 1, 1, 769500, 0x1, 153900, 1}, {154000, 1250, 1925100, 0x05, 0x1, 0x1, 713, 0x163,
0x162 , 0x00A, 0x00B, 3850200, 1, 1, 1, 1, 1, 962550, 0x1, 192510, 1},
{154000, 1500, 2311200, 0x05, 0x1, 0x1, 856, 0x1AA, 0x1AA, 30, 0x00D, 0x00D, 4622400, 1, 1, 1, 1, 1, 1155600, 0x1, 231120, 4200}, {1500, 0x1, 231120, 4200}
, , 3078000, 0x05, 0x1, 0x1, 570, 0x11B, 0x11B, 20, 0x008, 0x008, 3078000, 1, 1, 1, 1, 1, 1539000, 0x0, 307800, 1} #endif
}
;
在将 android 图像编译并编程到我的板上之后。仍然没有信号输出。
有以下内核信息:
[1.399928]imx-drm显示子系统:绑定32c00000.hdmi(ops imx_hdp_imx_ops)
[1.419216][drm]像素时钟频率:40000 KHz,字符时钟频率:40000,颜色深度为8位。
[ 1.419236] [drm] 此颜色深度(8 位)支持像素时钟频率(40000 KHz)。在第 31 行中找到的设置
[1.419277] [drm] VCO 频率为 3202200
[ 1.419284] [drm] 支持 VCO 频率 (3202200 KHz)。在第 16 行[1.433709] [drm] CDN_API_General_Write_Register_blocking LANES_CONFIG ret = 0中找到的设置
据我所知,它表示生成了 40M 像素时钟。但是为什么没有hdmi信号输出呢?
任何专家都可以帮助我吗?非常感谢。
有几点我怀疑:
1. t28hpc_hdmitx_clock_control_table_pixel_out中的40M pixel clock out设置正确吗?
2. 我也参考了
HDMI - pixel clock calculation.xlsx来生成设置,但是好像和t28hpc_hdmitx_clock_control_table_pixel_out的模式不一样。
那么如何在t28hpc_hdmitx_clock_control_table_pixel_out中计算这些设置。那么如何计算t28hpc_hdmitx_pll_tuning_table_pixel_out中的设置。变数太多了。