How does the HDMI interface of IMX8MQ output non-standard resolution (kernel5.10.72)?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How does the HDMI interface of IMX8MQ output non-standard resolution (kernel5.10.72)?

1,170 次查看
ximenbingmeng
Contributor IV
We are using the IMX8MQ chip, and the kernel version we previously used was kernel4.14.98. I can find the table for configuring pixel_clockfrequency and it can be configured successfully. We have found the tool for the table "HDMI - pixel clock calculation"
But in order to achieve dual screen display function, we upgraded the kernel version to kernel5.10.72,
We can find the relevant kernel code for configuring pixel clock frequency as follows, in the file cdns mhdp hdmi phy. c,
/* HDMI TX clock control settings,  pixel clock is output */
static const struct hdmi_ctrl imx8mq_ctrl_table[]
and
/* HDMI TX PLL tuning settings,  pixel clock is output */
static const struct hdmi_pll_tuning imx8mq_pll_table[]
And it can be seen that the approximate function call relationship is cdns_hdmi_phy_set_imx8mq ->hdmi_phy_cfg_t28hpc ->hdmi_feedback_factor ->imx8mq_ctrl-table [] and imx8mq_pll_table []
 
But in kernel 4.14.98, there is a path in drivers/gpu/drm/imx/hpd/imx hpd. c similar to the following
struct drm_display_mode *g_mode;
uint8_t g_default_mode = 0;
static struct drm_display_mode edid_cea_modes[] = {
/* 97 -  3840x2160@60Hz  */
{ DRM_MODE("3840x2160",  DRM_MODE_TYPE_DRIVER, 594000,
3840, 4016, 4104, 4400, 0,
2160, 2168, 2178, 2250, 0,
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
}
And the table edit_cea_modes [] is called in the file imx hpd. c by the function imx_hdp-connector_get_modes ->imx_hdp-default_video_modes based on if (! Hdp ->no_edid). The main requirement is to call hdp ->no_edid=of properties read_bool (pdev ->dev. of node, "fsl, no_edid") during registration; By configuring the device tree no_edid, it is possible to force the output of any resolution;
And drivers/gpu/drm/drm edid. c is related to configuring EDID, which we do not need to consider in kernel 4.14.98;
 
However, in kernel 5.10.72, we can only see the drm_edid. c file and not the imx hpd. c file. It feels like the DRM display framework has undergone significant changes. So how can we achieve this?
We have looked at Chapter 6.4.6 of the reference manual "IMX_REFERENCE_MANUAL" and can only see that there is a strong correlation between drivers/gpu/dr m/bridge/cadence and drivers/gpu/drm/mhdp. Then, I looked at the cdns hdmi core.c
static const struct drm_bridge_funcs cdns_hdmi_bridge_funcs = {
.attach = cdns_hdmi_bridge_attach,
.enable = cdns_hdmi_bridge_enable,
.disable = cdns_hdmi_bridge_disable,
.mode_set = cdns_hdmi_bridge_mode_set,
.mode_valid = cdns_hdmi_bridge_mode_valid,
.mode_fixup = cdns_hdmi_bridge_mode_fixup,
};
When was the .mode_set called? The others appear to be calling the drivers cdns-mhdp-imxdrv.c and cdns-mhdp-hdmi-phy.c,
a. So, does the DRM framework of kernel 5.10.72 only support reading EDIDs?
b. Is the DRM framework source code open? Do you have any learning materials?
c. We have read the following article and set the resolution by reading firmware under tools/edid. However, there is an error in the default compilation? Can you provide the correct edid folder?
 
This is very important to us, but after upgrading the version, the original function cannot be used anymore? Does it feel very strange, or is there something we didn't notice? I also hope to provide tips and detailed guidance.
I hope you can reply as soon as possible, thank you very much!!!
0 项奖励
回复
3 回复数

1,137 次查看
joanxie
NXP TechSupport
NXP TechSupport

for non-understand resolution, you still can get the timings according to the tools, then put them into imx8mq_pll_table, so what's your issue? the same HDMI display doesn't work on 5.10.72 but works on 4.9.88?

0 项奖励
回复

1,124 次查看
ximenbingmeng
Contributor IV

For example, I need to click a set of 3400x1300 resolution. For kernel5.10.72, in the path drivers/gpu/drm/mhdp/cdns-mhdp-hdmi-phy.c, I modified the following two places and added them to the last line of the two tables
/* HDMI TX clock control settings, pixel clock is output */
static const struct hdmi_ctrl imx8mq_ctrl_table[] = {
{283500, 283500, 1000, 2835000, 2835000, 0x04, 0x1, 0x1, 420, 0x14C, 0x054, 10, 0x003, 0x003, 2835000, 2835000, 0, 1, 1, 2, 1, 0x0, 283500, 283500},
}和
/* HDMI TX PLL tuning settings, pixel clock is output */
static const struct hdmi_pll_tuning imx8mq_pll_table[] = {
/* bin VCO_freq min/max coar cod NDAC PMOS PTAT div-T P-Gain Coa V2I CAL */
{42, 2835000, 2835000, 0x6, 0x3, 0x1, 0x00, 0x07, 420, 0x42, 183, 6, 225},
};

However, in kernel 5.10.72, we did not study the drm driver thoroughly, and I don't know how to "call" this resolution.
1. Can it still be forced to output through the IMX8MQ chip? What areas need to be modified? There is a drivers/gpu/drm/imx/hpd/imx-hpd.c file on kernel4.14.98. I can modify drm_display_mode edid_cea_modes[] to call it;
struct drm_display_mode *g_mode;
uint8_t g_default_mode = 0;
static struct drm_display_mode edid_cea_modes[] = {
{ DRM_MODE("3400x1300", DRM_MODE_TYPE_DRIVER, 283500, 3400, 3448,
3480, 3504, 0, 1300, 1314, 1315, 1348, 0,
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
}
But how should I call it in kernel5.10.72? I hope you can give me detailed technical guidance, thank you very much!
2. Or do I have to write a way to call the edid.bin file with a resolution of 3400x1300 EDID?
3. Or set video=HDMI-A-1:3400x1300@60 when uboot starts;
Looking forward to your early reply, thank you very much!

标记 (1)
0 项奖励
回复

1,055 次查看
joanxie
NXP TechSupport
NXP TechSupport

refer to the print information

 cdns-mhdp-imx 32c00000.hdmi: 0,ff,ff,ff,ff,ff,ff,0
 [drm] Reg val is 0x0080
 [drm] hdmi phy shutdown complete
 [drm] Mode: 3840x2160p297000
 [drm] Pixel clock: 297000 KHz, character clock: 297000, bpc is 8-bit, fmt 1
 [drm] VCO frequency is 2970000 KHz
 [drm] Sink Not Support SCDC

 you can find the mode is called by the cdns-hdmi-core.c,

static const struct drm_bridge_funcs cdns_hdmi_bridge_funcs = {
.attach = cdns_hdmi_bridge_attach,
.enable = cdns_hdmi_bridge_enable,
.disable = cdns_hdmi_bridge_disable,
.mode_set = cdns_hdmi_bridge_mode_set,
.mode_valid = cdns_hdmi_bridge_mode_valid,
.mode_fixup = cdns_hdmi_bridge_mode_fixup,
};

then the mode_set is called by the  drm_bridge.c as below path

https://github.com/nxp-imx/linux-imx/blob/b586a521770e508d1d440ccb085c7696b9d6d387/drivers/gpu/drm/d...

0 项奖励
回复