1024x768 Resolution Over HDMI on iMX8M

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

1024x768 Resolution Over HDMI on iMX8M

2,801 Views
sr4258
Contributor II

Hello,

For backwards compatibility to an existing product, we need to drive a DVI display at a resolution of 1024x768.

If I connect a 1080P display to the board with an HDMI to DVI cable, the display works just fine (so the issue is not with the board or the cable).  However, if I connect a display whose native resolution is 1024x768, the display fails to initialize and I see several '[drm] Cannot find any crtc or sizes' errors in the boot log.  Weston also fails to start, but that is understandable if there is no display.

The EDID of the monitor is being received and stored in /sys/class/drm/card0-HDMI-A-1/edid (attached).  Here are the supported modes of the monitor per the received EDID:

  Established Timings I & II:
    IBM     :   720x400    70.082 Hz   9:5    31.467 kHz  28.320 MHz
    DMT 0x04:   640x480    59.940 Hz   4:3    31.469 kHz  25.175 MHz
    Apple   :   640x480    66.667 Hz   4:3    35.000 kHz  30.240 MHz
    DMT 0x05:   640x480    72.809 Hz   4:3    37.861 kHz  31.500 MHz
    DMT 0x06:   640x480    75.000 Hz   4:3    37.500 kHz  31.500 MHz
    DMT 0x08:   800x600    56.250 Hz   4:3    35.156 kHz  36.000 MHz
    DMT 0x09:   800x600    60.317 Hz   4:3    37.879 kHz  40.000 MHz
    DMT 0x0a:   800x600    72.188 Hz   4:3    48.077 kHz  50.000 MHz
    DMT 0x0b:   800x600    75.000 Hz   4:3    46.875 kHz  49.500 MHz
    DMT 0x10:  1024x768    60.004 Hz   4:3    48.363 kHz  65.000 MHz
    DMT 0x11:  1024x768    70.069 Hz   4:3    56.476 kHz  75.000 MHz
    DMT 0x12:  1024x768    75.029 Hz   4:3    60.023 kHz  78.750 MHz
  Standard Timings: none

Overriding the EDID using 'drm.edid_firmware=HDMI-A-1:edid/1024x768.bin' also does not work.

I have been digging around in the source code, and I suspect that the supported resolutions / pixel clocks on the HDMI output are limited, based on the 'imx8mq-hdmi does not support non CEA modes' comment I stumbled across.

However, I will still pose the question: Is there any way to drive a display at 1024x768 using the HDMI port?

Thanks.

Other Details:

  • Board: Boundary Devices Nitrogen8M
  • OS: Linux, Yocto, Gatesgarth
4 Replies

2,724 Views
sr4258
Contributor II

Igor,

Thanks for the quick response and the spreadsheet, however I still feel like I'm missing something.  I used the spreadsheet to calculate a solution that appears to work (everything is marked as 'OK):

sr4258_0-1620135048665.jpeg

However when I add the parameters from the spreadsheet to imx8mq_ctrl_table in cdns-mdhp-hdmi-phy.c:

{ 78750, 78750, 1000, 787500, 787500, 0x03, 0x1, 0x1, 350, 0x114, 0x046, 40, 0x012, 0x012, 3150000, 3150000, 1, 2, 2, 2, 2, 0x2, 78750, 78750},

I get a new error in the boot log:

[ 3.911538] [drm] Mode: 1024x768p78750
[ 3.944789] [drm] feedback_factor: 1000
[ 3.948632] [drm] pixel_freq: 78750
[ 3.952121] [drm] Pixel clock: 78750 KHz, character clock: 78750, bpc is 8-bit.
[ 3.959438] [drm] VCO (3150000 KHz) not supported
[ 3.964155] [drm:cdns_hdmi_phy_set_imx8mq] *ERROR* failed to set phy pclock

This is because there is another table (imx8mq_pll_table) which is used to place additional restrictions on some of the parameter values (restrictions which the spreadsheet does not seem to enforce):

/* Get right row from the imx8mq_pll_table table.
* Check if vco_freq_khz and feedback_div_total
* column matching with imx8mq_pll_table. */
for (i = 0; i < ARRAY_SIZE(imx8mq_pll_table); i++) {
  if (vco_freq == imx8mq_pll_table[i].vco_freq_min &&
      div_total == imx8mq_pll_table[i].feedback_div_total) {
        p_pll_table = &imx8mq_pll_table[i];
        break;
  }
}
if (i == ARRAY_SIZE(imx8mq_pll_table)) {
  DRM_WARN("VCO (%d KHz) not supported\n", vco_freq);
  return 0;
}

Specifically, vco_freq (D24 in the spreadsheet) and feedback_div_total (D19 in the spreadsheet) must match a line in imx8mq_pll_table to be considered ‘valid’.  My solution above does not pass this test, hence the error.

I will continue to tinker around with the spreadsheet to see if I can find another solution that works, but can imx8mq_pll_table be modified to allow the solution above to function?

Thanks.

0 Kudos

2,712 Views
sr4258
Contributor II

Just a quick update to my previous post.

I stumbled across this post:

https://community.nxp.com/t5/i-MX-Graphics/Driving-a-1080x1920-portrait-HDMI-screen/td-p/1213323

And following the solution on the linked StackOverflow post, I modified the following line in imx8mq_pll_table:

{ 5, 3150000, 3150000, 0x6, 0x3, 0x1, 0x00, 0x07, 350, 0x42, 183, 6, 225 },

This, along with the addition to imx8mq_ctrl_table, resulted in an image displaying on the monitor in 1024x768!

However, randomly modifying table entries feels a bit "how-ya-doing" (to quote Dave Jones) and there appear to be occasional, faint, graphical glitches on the monitor, so the solution is not perfect.

Is there another document or spreadsheet that describes the values in imx8mq_pll_table along with how to modify them properly?

Thanks.

0 Kudos

2,705 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sebastian

 

unfortunately other documentation is not available, sorry. Since this is non-standard resolution

may be recommended to proceed with help of  https://contact.nxp.com/new-prof-svcs-sw-tech

 

Best regards
igor

0 Kudos

2,783 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sebastian

 

one can try solution described below

https://community.nxp.com/t5/i-MX-Processors/HDMI-DRM-custom-resolution-and-clock-frequency/m-p/1180...

 

Best regards
igor

0 Kudos