Add custom display resolution of 480x1280

Hello,

I want to add support to linux kernel for custom lcd display with resolution of 480x1280. Evaluation board which came with this display has HDMI connection. I have already tried to add this resolution with xrandr and it works, but now I would like to support it in linux kernel so the splash screen would also be shown.

In the past I have already add support for custom display with resolution of 640x240 which was connected to LVDS port - this was trivial where I have just specified new timing in device tree in lvds-channel@0 node.

What are the proper steeps to add support for custom resolution if this custom display is connected over HDMI?
Is it possible to add custom timings into device tree for HDMI output as well?

Regars, Mlinar

Greetings @mlinar!

Usually HDMI displays send EDID data over the HDMI connection and set the correct resolution automatically. Alternatively, it might work to set your custom resolution via the vidargs environment variable on U-Boot, but AFAIK this only supports valid CEA settings such as 480p, 720p and 1080p. More on this here.

Which resolution is it set to before you use xrandr? Can you also provide any relevant logs so we can find more about your display’s EDID? xrandr --props might be useful in this case.

Usually HDMI displays send EDID data over the HDMI connection and set the correct resolution automatically. Alternatively, it might work to set your custom resolution via the vidargs environment variable on U-Boot, but AFAIK this only supports valid CEA settings such as 480p, 720p and 1080p. More on this here.

Yes I am aware of that; this is EDID data retrieved from display with find /sys/ -name edid -exec cat {} ~;

0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00 0x31 0xEE 0x02 0x2C 0x01 0x01 0x01 0x01
0x01 0x1A 0x01 0x03 0x80 0x59 0x32 0x78 0x0A 0x0D 0xC9 0xA0 0x57 0x47 0x98 0x27
0x12 0x48 0x4C 0x20 0x00 0x00 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
0x01 0x01 0x01 0x01 0x01 0x01 0x08 0x16 0xE0 0xF0 0x10 0x00 0x16 0x50 0x64 0x28
0xA2 0x00 0xE0 0x00 0x15 0x00 0x00 0x1E 0x01 0x1D 0x00 0x72 0x51 0xD0 0x1E 0x20
0x6E 0x28 0x55 0x00 0xC4 0x8E 0x21 0x00 0x00 0x1E 0x00 0x00 0x00 0xFD 0x00 0x16
0x48 0x0F 0x5A 0x14 0x00 0x0A 0x20 0x20 0x20 0x20 0x20 0x20 0x00 0x00 0x00 0xFC
0x00 0x4C 0x6F 0x6E 0x74 0x69 0x75 0x6D 0x20 0x53 0x65 0x6D 0x69 0x0A 0x01 0x11
0x02 0x03 0x27 0xF1 0x49 0x90 0x1F 0x05 0x04 0x13 0x14 0x03 0x02 0x01 0x23 0x09
0x07 0x07 0x83 0x01 0x00 0x00 0x6D 0x03 0x0C 0x00 0x10 0x00 0x00 0x3C 0x20 0x00
0x60 0x01 0x02 0x03 0xE2 0x00 0x0F 0xD6 0x09 0x80 0xA0 0x20 0xE0 0x2D 0x10 0x08
0x60 0x22 0x00 0x12 0x8E 0x21 0x08 0x08 0x18 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x09
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Which resolution is it set to before you use xrandr?

I have also set vidargs to setenv vidargs 'mxc_hdmi.only_cea=0 video=mxcfb0:dev=hdmi,480x1280M@60,if=RGB24 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off fbmem=32M'

But the system sets it back to 1920x1080.

Can you also provide any relevant logs so we can find more about your display’s EDID? xrandr --props might be useful in this case.

root@apalis-imx6:~# xrandr --props
Screen 0: minimum 240 x 240, current 1920 x 1080, maximum 8192 x 8192
DISP3 BG connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
        non-desktop: 0
                supported: 0, 1
   S:1920x1080p-60  60.00*+
   S:1920x1080p-50  50.00
   S:1280x720p-50  50.00
   S:1280x720p-60  60.00
   S:720x480p-60  59.94
   V:640x480p-60  60.00
   S:640x480p-60  60.00

@mlinar,

It seems this EDID is valid and the timings descriptor indeed states the 480x1280 resolution. Reading this with an EDID reader yields:

Detailed Timing Descriptor
Pixel Clock: 56.4MHz 
Horizontal Active: 480 
Horizontal Blanking: 240 
Vertical Active: 1280 
Vertical Blanking: 22 
Horizontal Sync Offset: 100 
Horizontal Sync Pulse: 40 
Vertical Sync Offset: 10 
Vertical Sync Pulse: 2 
Horizontal Display Size: 480 
Vertical Display Size: 1280 
Horizontal Border: 0 
Vertical Border: 0 
Interlaced: false 
Stereo Mode: 0 
Sync Type: 3 

Since the descriptor is apparently valid, I suggest you to try clearing the vidargs variable completely (e.g. setenv vidargs ''). My idea is that this may force the system to get the correct resolution from the descriptor.

Clearing vidargs didn’t work, it fallback to 1024x768.

Doesn’t clearing vidargs env fallback to device tree defaults?

Attached is dmesg log.link text

@mlinar,

Yes, clearing vidargs should make the device tree defaults rule, but since I don’t think there’s specific timings for HDMI set in the device tree, I figured Linux would perhaps get the right info from the descriptor, but sadly that’s not the case.

I’ll take a deeper look at this and get back to you.

@gustavo.tx

If it helps, attached is dmesg.log of bootlog where I have enabled debug prints in mxc_edid.c file.

if I can assist in any other way please let me know.
Thanks for the help

@mlinar,

Just want to let you know we’re looking into this. We’ve seen other issues with EDIDs and other displays, particularly with non-standard resolutions. We’ll let you know about any solutions.

@gustavo.tx thanks for the info, if you have any patch to try/test I am glad to help so let me know

Regards, Mlinar

@mlinar,

Sure, we’re tackling this and I’ll make sure to keep you up-to-date on this.

I suggest you use the xrandr workaround for now. For the splash screen, you can try changing the splash screen for a rotated one. We have an article regarding this subject here.

Hi,

I have used workaround from @benjamin.tx from this topic until this issue is resolved.

Regards, Mlinar

Hi @mlinar!

Thanks for the feedback, good to know this is a suitable workaround.

Best regards,

Gustavo.