Timing in Detailed Timing Descriptor not added to modes with Linux verdin-imx8mp

We have a custom carrier board with Verdin SOM. To its native HDMI port we connect a MI0700BNT-7CP1-HB1 screen. The screen works, but with wrong resolution. Both our linux and the depo application preinstalled on Verdin has this error.

I checked EDID, and the desired resolution is specified as the only Detailed Timing Descriptor. Here is the EDID:

# xxd -p -g1 /sys/class/drm/card0-HDMI-A-2/ 
00ffffffffffff004a8b7e56d905000004120103eb3120780aaec5a2574a
9c251250543fdf8001010101010101010101010101010101941100b04058
192030203600da28110000180000000f0068646d690a0a0a0a0a0a0a0a0a
000000fd00384b1c530f000a202020202020000000fc0057323235320a20
202020202020001a
#

For reference, here is the EDID decoded:

# edid-decode edid.bin          
edid-decode (hex):                                   
                                                     
00 ff ff ff ff ff ff 00 4a 8b 7e 56 d9 05 00 00      
04 12 01 03 eb 31 20 78 0a ae c5 a2 57 4a 9c 25      
12 50 54 3f df 80 01 01 01 01 01 01 01 01 01 01      
01 01 01 01 01 01 94 11 00 b0 40 58 19 20 30 20      
36 00 da 28 11 00 00 18 00 00 00 0f 00 68 64 6d      
69 0a 0a 0a 0a 0a 0a 0a 0a 0a 00 00 00 fd 00 38      
4b 1c 53 0f 00 0a 20 20 20 20 20 20 00 00 00 fc      
00 57 32 32 35 32 0a 20 20 20 20 20 20 20 00 1a                                                           
                                                     
----------------                                                                                          
                                                                                                          
Block 0, Base EDID:                                                                                       
  EDID Structure Version & Revision: 1.3                                                                  
  Vendor & Product Identification:                                                                        
    Manufacturer: RTK                                                                                     
    Model: 22142                                                                                          
    Serial Number: 1497                                                                                   
    Made in: week 4 of 2008                          
  Basic Display Parameters & Features:               
    Digital display                                                                                       
    DFP 1.x compatible TMDS                                                                               
    Maximum image size: 49 cm x 32 cm                                                                     
    Gamma: 2.20                                                                                           
    RGB color display                                                                                     
    First detailed timing is the preferred timing                                                         
  Color Characteristics:                                                                                  
    Red  : 0.6347, 0.3417                                                                                 
    Green: 0.2919, 0.6113                                                                                 
    Blue : 0.1474, 0.0703                                                                                 
    White: 0.3134, 0.3291                            
  Established Timings I & II:
    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 0x0f:  1024x768i   86.958 Hz   4:3    35.522 kHz   44.900 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
    DMT 0x24:  1280x1024   75.025 Hz   5:4    79.976 kHz  135.000 MHz
    Apple   :  1152x870    75.062 Hz 192:145  68.681 kHz  100.000 MHz
  Standard Timings: none                             
  Detailed Timing Descriptors:
    DTD 1:  1024x600    60.000 Hz 128:75   37.500 kHz   45.000 MHz (474 mm x 296 mm)
                 Hfront   48 Hsync  32 Hback  96 Hpol N
                 Vfront    3 Vsync   6 Vback  16 Vpol N
    Manufacturer-Specified Display Descriptor (0x0f): 00 0f 00 68 64 6d 69 0a 0a 0a 0a 0a 0a 0a 0a 0a '...hdmi.........'
  Display Range Limits:                              
    Monitor ranges (GTF): 56-75 Hz V, 28-83 kHz H, max dotclock 150 MHz
    Display Product Name: 'W2252'
Checksum: 0x1a 
#

When I connect the display to our board and check the avialable modes, the native resolution 1024x600 is missing:

# cat /sys/class/drm/card0-HDMI-A-2/modes
1280x1024
1152x864
800x600
800x600
640x480
#

But when I connect the display to my x86 laptop, the resolution is fine:

# cat /sys/class/drm/card0-HDMI-A-3/modes 
1024x600
1280x1024
1152x864
1024x768i
1024x768
1024x768
1024x768
800x600
800x600
800x600
800x600
640x480
640x480
640x480
640x480
#

This is how the screen looks when the example app is running. Notice the cog in the left bottom corner is squished. It is not extremely apparent, but, if there was a big circle in the middle of the screen (as in our application), it would look like an ellipse. bad resolution display photo

Here is output of modeset, when video=HDMI-A-2:1024x600 is on kernel command line and weston was started with mode=current:

Encoders:
id	crtc	type	possible crtcs	possible clones	
37	0	DSI	0x00000001	0xffffffff
39	36	TMDS	0x00000002	0x00000000

Connectors:
id	encoder	status		name		size (mm)	modes	encoders
38	0	disconnected	HDMI-A-1       	0x0		0	37
  props:
	1 EDID:
		flags: immutable blob
		blobs:

		value:
	2 DPMS:
		flags: enum
		enums: On=0 Standby=1 Suspend=2 Off=3
		value: 0
	5 link-status:
		flags: enum
		enums: Good=0 Bad=1
		value: 0
	6 non-desktop:
		flags: immutable range
		values: 0 1
		value: 0
	4 TILE:
		flags: immutable blob
		blobs:

		value:
40	39	connected	HDMI-A-2       	490x320		5	39
  modes:
	index name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  #0 1280x1024 75.02 1280 1296 1440 1688 1024 1025 1028 1066 135000 flags: phsync, pvsync; type: driver
  #1 1152x864 75.00 1152 1216 1344 1600 864 865 868 900 108000 flags: phsync, pvsync; type: driver
  #2 800x600 60.32 800 840 968 1056 600 601 605 628 40000 flags: phsync, pvsync; type: driver
  #3 800x600 56.25 800 824 896 1024 600 601 603 625 36000 flags: phsync, pvsync; type: driver
  #4 640x480 59.94 640 656 752 800 480 490 492 525 25175 flags: nhsync, nvsync; type: driver
  props:
	1 EDID:
		flags: immutable blob
		blobs:

		value:
			00ffffffffffff004a8b7e56d9050000
			04120103eb3120780aaec5a2574a9c25
			1250543fdf8001010101010101010101
			010101010101941100b0405819203020
			3600da28110000180000000f0068646d
			690a0a0a0a0a0a0a0a0a000000fd0038
			4b1c530f000a202020202020000000fc
			0057323235320a20202020202020001a
	2 DPMS:
		flags: enum
		enums: On=0 Standby=1 Suspend=2 Off=3
		value: 0
	5 link-status:
		flags: enum
		enums: Good=0 Bad=1
		value: 0
	6 non-desktop:
		flags: immutable range
		values: 0 1
		value: 0
	4 TILE:
		flags: immutable blob
		blobs:

		value:

CRTCs:
id	fb	pos	size
33	0	(0,0)	(0x0)
  #0  nan 0 0 0 0 0 0 0 0 0 flags: ; type: 
  props:
	24 VRR_ENABLED:
		flags: range
		values: 0 1
		value: 0
36	41	(0,0)	(1280x1024)
  #0 1280x1024 75.02 1280 1296 1440 1688 1024 1025 1028 1066 135000 flags: phsync, pvsync; type: driver
  props:
	24 VRR_ENABLED:
		flags: range
		values: 0 1
		value: 0

Planes:
id	crtc	fb	CRTC x,y	x,y	gamma size	possible crtcs
31	0	0	0,0		0,0	0       	0x00000001
  formats: XR24 AR24 RG16 XB24 AB24 AR15 XR15
  props:
	8 type:
		flags: immutable enum
		enums: Overlay=0 Primary=1 Cursor=2
		value: 1
	32 zpos:
		flags: immutable range
		values: 0 0
		value: 0
34	36	41	0,0		0,0	0       	0x00000002
  formats: XR24 AR24 RG16 XB24 AB24 AR15 XR15
  props:
	8 type:
		flags: immutable enum
		enums: Overlay=0 Primary=1 Cursor=2
		value: 1
	35 zpos:
		flags: immutable range
		values: 0 0
		value: 0

Frame buffers:
id	size	pitch

Is there anything I could check to get the right resolution?

Hi @adam.trhon,

Thanks for using the Toradex community.

Did you check our developer article about Display Resolutions?

Verdin Display Resolutions

Best Regards
Kevin

Hello, I checked it.

I tried adding video=HDMI-A-2:1024x600 to vidargs. The resolution then appeared among modes, but, disappeared as soon as weston was started. Also the login prompt was not visible after boot.

I also wanted to apply the verdin-imx8mp_native-hdmi_overlay.dtbo overlay, but it is not available on the board. I am going to build and try it with our BSP.

Is there anything else, that I missed?

Hi @adam.trhon,

I will keep you posted on the unexpected weston behaviour.

In the mean time you could download the overlays from our git.

Overlays Sources

Let me know about your progress.

Best Regards
Kevin

@kevin.tx Iapplied the verdin-imx8mp_native-hdmi_overlay.dtbo overlay, but it did not help.

I also connected a full hd monitor to the board, and it worked fine (EDID was loaded, all the modes listed in /sys/…/modes). Maybe there is some problem with the EDID posted here? Is there a way to validate it?

EDIT: When writing this, I didn’t realize that the small display worked when connected to my laptop. So the EDID could be right after all…

Hi @adam.trhon,

a convenient way to look at EDID code is using http://www.edidreader.com.

I can see some mismatch between what your expecting and what the EDID actually encodes. According to the decoded EDID the standard display modes are set to 888x666 and 752x423.

Would it be possible for you to attach a picture of the screen with the wrong resolution?

BR,
Kevin

Hi @kevin.tx,

I added the screenshot. We experimented with adding our own EDID, but no success so far. Anyway, would you please also explain (or just point me to some resource) how did you deduced the 888x666 and 752x423 resolutions?

Adam

Dear @adam.trhon,

after looking at the data a second time it became obvious that somehow a mistake snuck in. I apologize for the confusion. I now have the correct descriptor on my side as well.

Detailed Timing Descriptor
Pixel Clock: 45MHz
Horizontal Active: 1024
Horizontal Blanking: 176
Vertical Active: 600
Vertical Blanking: 25
Horizontal Sync Offset: 48
Horizontal Sync Pulse: 32
Vertical Sync Offset: 3
Vertical Sync Pulse: 6
Horizontal Display Size: 474
Vertical Display Size: 296
Horizontal Border: 0
Vertical Border: 0
Interlaced: false
Stereo Mode: 0
Sync Type: 3

If you follow the link below you will find some information about getting the currently loaded configuration of your device.

Display Resolutions

It might be helpful to execute the command “modetest -M imx-drm” to get some more information about the configuration.

Now, regarding the disappearing of the mode as soon as weston starts, could be the result of weston reevaluating the current setup after you already defined your preferred setting by using video=HDMI-A-2:1024x600.

One way to get around this is by changing the configuration of weston, so that weston is not trying to evaluate the display situation. You achieve this by opening the file /etc/xdg/weston/weston.ini
There you should be able to find a section labeled “output”. It should look similar to this code sample. The goal here is to chose the mode=current, as seen in the example code.

An alternative method would be to fully disable weston. If that is a viable option for you. To achieve that, you have to disable it by using systemctl. The command you need to execute is as follows:

systemctl disable weston@root.service

An overview on how to enable/disable services like this you can find in one of our developer articles.

Let me know, if this leads to some progress on you side. I would be keen to know more.

I hope I did not confuse you too much with my first message.

Have a nice day and if there are any other question, feel free to reach out.

Best Regards
Kevin

Hi @kevin.tx ,
I tried modetest -M imx-drm, it only shows the modes available in /sys/…/modes. I am not sure if I shall insert it here, it has about 100 lines.

I also tried to set mode to current in weston, while having video=HDMI-A-2:1024x600 on kernel command line. The application looks the same. The only difference is that without the kernel command line argument, we can see the debug messages and fat Tuxes during boot, while with the argument, we don’t see anything.

Disabling weston is not an option for us. Also, it seems like there is nothing visible with the kernel args.

Thank you
Adam

Hi @kevin.tx in our BSP we also got to this message after adding the modeline to weston.ini:

[ 140.449648] [drm:drm_mode_debug_printmodeline] Modeline "1024x600": 60 45000 1024 1072 1104 1200 600 603 609 625 0x48 0xa
[ 140.449656] [drm:drm_mode_prune_invalid] Not using 1024x600 mode: CLOCK_RANGE

We tried our BSP here, not the reference one, as the reference one reboots immediately in this scenario.

Hi @adam.trhon,

Thanks for the insight.

Yes, if possible please put the output in a file and attach it here.

BR
Kevin

Hi @kevin.tx ,

thank you (and Max) very much! We tested the patch and it fixes the problem.

Best regards
Adam

Hi @adam.trhon,

thanks for letting us know. Glad that the issue was fixed.

Feel free to reach out again in the future, if you encounter any other issues.

BR
Kevin

Hi @adam.trhon,

the situation is as follows.

The pixel clock that is used to drive your display is not part of the drivers set of known configurations. If you look at the output from the mode-test command that you provided yesterday, you can see which modes are currently available for your configuration.

modes:
     index name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
   #0 1280x1024 75.02 1280 1296 1440 1688 1024 1025 1028 1066 135000 flags: phsync, pvsync; type: driver
   #1 1152x864 75.00 1152 1216 1344 1600 864 865 868 900 108000 flags: phsync, pvsync; type: driver
   #2 800x600 60.32 800 840 968 1056 600 601 605 628 40000 flags: phsync, pvsync; type: driver
   #3 800x600 56.25 800 824 896 1024 600 601 603 625 36000 flags: phsync, pvsync; type: driver
   #4 640x480 59.94 640 656 752 800 480 490 492 525 25175 flags: nhsync, nvsync; type: driver

In other words, the driver does currently not support this. Our team however is already working on changing that. For your case, one of our experts created a patch that you could try. This should work and remove the wrong resolution.

Patch

Best Regards
Kevin