How to check EDID with DRM interface. Wrong/bad output resolution

Apalis IMX8QM 4GB WB IT V1.1C
Ixora V1.2A
Custom linux based on tdx-reference-multimedia-image, without wayland and with Qt5 EGLFS + gstreamer 1.18

Hello,

I want to know if it is possible to :

  • read EDID from HDMI ( with DRM interface )
  • force a resoluton with DRM interface.

if I plug the ixora board + apalis IMX8QM:

  • on a 4K samsung TV 40’’ UE40MU9106K , the output is 3840x2160@60 and kernel says :
    [ 6.084313] [drm] Mode: 3840x2160p594000
    [ 6.112738] [drm] Pixel clock: 594000 KHz, character clock: 594000, bpc is 8-bit.
    [ 6.112747] [drm] VCO frequency is 5940000 KHz
    [ 6.448372] imx-drm display-subsystem: fb0: imx-drmdrmfb frame buffer device
  • on a 4K samsung TV 49’’ QE49Q7, the output is 3840x2160@30 and kernel says :
    [ 6.625556] [drm] Mode: 3840x2160p297000
    [ 6.652563] [drm] Pixel clock: 297000 KHz, character clock: 297000, bpc is 8-bit.
    [ 6.652571] [drm] VCO frequency is 2970000 KHz

Both TV supports 4K@60 , so I don’t know why on one TV , only 4K@30 is activated. I have tested with 2 different cards , and 3 HDMI cable ( 4K certified ) , nothing changes.

To investigate this, I need to be able to read the EDID , and/or force a specific resolution. But I don’t use wayland, it is a drm ( fb ) configuration.
Is it possible to do this ?

Regards,

F. MAZUR.

When I switch from one monitor to another , I have this output :

root@apalis-imx8-06980454:~# [ 35.808249] VDD_EXT_RGMII (LDO1): disabling
[ 35.812572] pcie_switch: disabling
[ 37.275113] [drm] HDMI Cable Plug Out
[ 41.487918] cdns-mhdp-imx 56268000.hdmi: 0,ff,ff,ff,ff,ff,ff,0
[ 41.496629] [drm] Mode: 3840x2160p297000
[ 41.528230] [drm] Pixel clock: 297000 KHz, character clock: 297000, bpc is 8-bit.
[ 41.535881] [drm] VCO frequency is 2970000 KHz
[ 41.593614] [drm] Sink Not Support SCDC
[ 41.742142] [drm] HDMI Cable Plug In

root@apalis-imx8-06980454:~#
root@apalis-imx8-06980454:~#
root@apalis-imx8-06980454:~# [ 83.208962] [drm] HDMI Cable Plug Out
[ 85.867319] cdns-mhdp-imx 56268000.hdmi: 0,ff,ff,ff,ff,ff,ff,0
[ 85.875904] [drm] Mode: 3840x2160p594000
[ 85.909005] [drm] Pixel clock: 594000 KHz, character clock: 594000, bpc is 8-bit.
[ 85.916664] [drm] VCO frequency is 5940000 KHz
[ 86.053404] [drm] HDMI Cable Plug In

The only difference is the message “Sink Not Support SCDC”. I don’t know what it means, and if it explains why 4k@60 don’t work on this monitor

Hi @f.mazur,
It seems that you can read the detected EDID of a connected HDMI monitor on apalis IMX8QM with:

root@apalis-imx8:/# hexdump -C /sys/class/drm/card1-HDMI-A-1/edid
00000000  00 ff ff ff ff ff ff 00  41 0c cd c0 8a d5 00 00  |........A.......|
00000010  18 1f 01 03 80 29 17 78  2a 0c c5 a4 57 50 a1 28  |.....).x*...WP.(|
00000020  0d 50 54 bd 4a 00 81 80  81 c0 81 40 01 01 01 01  |.PT.J......@....|
00000030  01 01 01 01 01 01 66 21  56 aa 51 00 1e 30 46 8f  |......f!V.Q..0F.|
00000040  33 00 9a e6 10 00 00 1e  00 00 00 ff 00 41 46 43  |3............AFC|
00000050  32 31 32 34 30 35 34 36  36 36 00 00 00 fc 00 50  |2124054666.....P|
00000060  48 4c 20 31 39 33 56 35  0a 20 20 20 00 00 00 fd  |HL 193V5.   ....|
00000070  00 38 4c 1e 53 11 00 0a  20 20 20 20 20 20 01 7d  |.8L.S...      .}|
00000080  02 03 16 b1 4b 01 02 03  06 07 11 12 13 15 16 04  |....K...........|
00000090  65 03 0c 00 10 00 01 1d  00 72 51 d0 1e 20 6e 28  |e........rQ.. n(|
000000a0  55 00 9a e6 10 00 00 1e  8c 0a d0 8a 20 e0 2d 10  |U........... .-.|
000000b0  10 3e 96 00 9a e6 10 00  00 18 8c 0a d0 90 20 40  |.>............ @|
000000c0  31 20 0c 40 55 00 9a e6  10 00 00 18 00 00 00 00  |1 .@U...........|
000000d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000000f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 bc  |................|
00000100

In order to force specific modes you could have a look at this:
https://developer.toradex.com/knowledge-base/display-output-resolution-and-timings-linux#Injecting_a_Binary_EDID_Blob
And in this document you’ll find information about how to build the custom EDID binary.
Please let me know if this helps you,
Rafael Beims

1 Like

Hello,

Thanks a lot for your answer.

I have dumped the edid for the QE49Q7 , here is the result ( with 010 editor + template edid ) :

If I follow this link : Extended Display Identification Data - Wikipedia

It seems that the screen should not support 2160p60 ?
“93” is 2160p24, “94” is 2160p25, “95” is 2160p30 ( for 16/9 - 1/1 ) , there is not “97” which should be 2160p60. I am surprised that the monitor doesn’t support 2160p60. I will try another device on it to be sure of this.

One another question. How should I force 2160p24 here ? ( which is better than 2160p60 for me ) just suppress all the display modes except “93” ( 2160p24 ) inside edid file, and inject it with the “inject binary edid blob” procedure ?

I will catch the edid from the other monitor ( the 40’’ which works ) to compare…

On the 40’’ monitor, the correct modes are available :

it is weird…

One another question. How should I force 2160p24 here ? ( which is better than 2160p60 for me ) just suppress all the display modes except “93” ( 2160p24 ) inside edid file, and inject it with the “inject binary edid blob” procedure ?

I think you could do exactly that, just create a binary EDID file with just the mode you want the monitor to work on, and then inject it using the command line as described in the article.

unfortunately, it doesn’t work. I have generated a 256byte edid file based on the original edid from the monitor, and I remove all the modes except 2160p24 ( 93 ).

I tried your link :

  • echo edid.bin > /sys/module/drm/parameters/edid_firmware → do nothing ( monitor plugged, unplugged and plugged again, nothing change )
  • cat edid.bin > /sys/kernel/debug/dri/0/HDMI-A-2/edid_override , for me it is : cat correct-edid.bin > /sys/kernel/debug/dri/1/HDMI-A-1/edid_override → it do nothing ( monitor plugged, unplugged, and plugged again , nothing change )

For the kernel command line, I don’t know where to edit it : drm.edid_firmware=edid/your_edid.bin
maybe uboot + setenv ? other thing ?

Every time I plug again the HDMI cable from the monitor, the /sys/class/drm/card1-HDMI-A-1/edid has the initial value ( all the modes without 2160p60 , including 2160p30 )

Maybe it is not possible to force the mode on this particular setup ?

That’s unfortunate. I looked it up a little bit more and it seems that it’s not just a matter of binary editing the EDID file and removing entries. EDID files contain at least a CRC, which would need to be recalculated correctly for it to work.
If you look inside the kernel sources, you’ll find this directory:

Documentation/EDID/

Inside it you will find several files that generate some monitor modes, together with a makefile to create the binaries. With that, I think you would need to have the proper data of your monitor for the correct mode you need and input it in a new file, and then generate a new EDID file.
Please see this answer for more info:

To check if the EDID you generated is indeed broken, I would suggest you to install the read-edid package on your linux distribution and then use something like:

cat edid.bin|parse-edid

You can also compile read-edid for the target and use it to parse the edid directly from the sysfs:

$ cat /sys/class/drm/card1-HDMI-A-1/edid|parse-edid
Checksum Correct
00000000  00 ff ff ff ff ff ff 00  41 0c cd c0 8a d5
Section "Monitor"
	Identifier "PHL 193V5"
	ModelName "PHL 193V5"
	VendorName "PHL"
	# Monitor Manufactured week 24 of 2021
	# EDID version 1.3
	# Digital Display
	DisplaySize 410 230
	Gamma 2.20
	Option "DPMS" "true"
	Horizsync 30-83
	VertRefresh 56-76
	# Maximum pixel clock is 170MHz
	#Not giving standard mode: 1280x1024, 60Hz
	#Not giving standard mode: 1280x720, 60Hz
	#Not giving standard mode: 1280x960, 60Hz

	#Extension block found. Parsing...
	Modeline 	"Mode 12" +hsync +vsync 
	Modeline 	"Mode 0" +hsync +vsync 
	Modeline 	"Mode 1" 25.200 640 656 752 800 480 490 492 525 -hsync -vsync
	Modeline 	"Mode 2" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
	Modeline 	"Mode 3" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
	Modeline 	"Mode 4" 27.027 1440 1478 1602 1716 480 484 487 525 -hsync -vsync interlace
	Modeline 	"Mode 5" 27.027 1440 1478 1602 1716 480 484 487 525 -hsync -vsync interlace
	Modeline 	"Mode 6" 27.000 720 732 796 864 576 581 586 625 -hsync -vsync
	Modeline 	"Mode 7" 27.000 720 732 796 864 576 581 586 625 -hsync -vsync
	Modeline 	"Mode 8" 74.250 1280 1720 1760 1980 720 725 730 750 +hsync +vsync
	Modeline 	"Mode 9" 27.000 1440 1464 1590 1728 576 578 581 625 -hsync -vsync interlace
	Modeline 	"Mode 10" 27.000 1440 1464 1590 1728 576 578 581 625 -hsync -vsync interlace
	Modeline 	"Mode 11" 74.250 1280 1390 1420 1650 720 725 730 750 +hsync +vsync
	Modeline 	"Mode 13" -hsync -vsync 
	Modeline 	"Mode 14" -hsync -vsync 
	Option "PreferredMode" "Mode 12"
EndSection

The output above is from my apalis imx8 with a 19" monitor connected to the HDMI port.

Hello,

I up this topic again after one month ( sorry , I was working on another subject ) , and I am working again on the edid issue and how to force a display mode.

I try another way and I have some questions. I ve tried the “modetest” binary and I was able to change the mode with this tools , but only as test purpose.
For example :
modetest -s 148:#7 , it changes the crtc 148 with the mode #7 ( the one I want) and it works. But it displays a test pattern, and then when I quit the software, It returns to the previous mode.

The card boots with the “preferred” mode , and I am not able nor to change the preferred mode neither to fix a specific mode.

Is there a tool ( with libdrm library and tool suite ) that allow to change dynamically the mode.

For example “modeset” or something else ? ( I ve tried fbset, but it doesn’t anything )

Another question : is it possible to configure the uboot, with a setenv command to set the default mode at start ?

I precise that we run our software in drmkms mode ( qt software -platform eglfs ) , there is no wayland/weston and no xorg server.

Thanks a lot.

I’ve tried to change the video variable inside uboot console, but it doesn’t have any effect

printenv video
setenv video HDMI-A-1:1920x1080@24
saveenv

I can remove the variable, it doesn’t change anything . Is it used ?

Hi @f.mazur

Please give the following commands on u-boot a try.

setenv tdxargs video=HDMI-A-1:1920x1080@24
saveenv

Please let us know if this had any effect.

Best Regards
Kevin

Hello,

I’ve just tried this and it works well. Thanks a lot for the information ( maybe this information was already available in toradex documentation ? )

Next step, I have to check how I can change change dynamically the mode. I have 3 ways :

  • is there a system command that allow a dynamic change ( like modetest , but permanently )
  • is it possible to call this change with a Qt GUI/QML application ? ( already integrated inside Qt API with drm backends )
  • analyze the source code of modetest to extract the part that change the mode, and integrate it inside our own application.

Hi @f.mazur !

Great that it worked for you!

Regarding the other questions, could you please create a new post?

Best regards,