compulab-yokneam / meta-bsp-imx8mp

13 stars 14 forks source link

iot-gate-imx8plus: specific 800x480 screen resolution over hdmi #26

Closed joelguittet closed 2 months ago

joelguittet commented 3 months ago

Hello

I have iot-gate-imx8plus and I would like to connect a specific screen which manage only 800x480 resolution. I'm building with Yocto (https://github.com/compulab-yokneam/meta-bsp-imx8mp/blob/iot-gate-imx8plus_r2.0/README.md) and the instructions given by the screen vendor seems not working. The screen works as expected with automatic detected resolution on my ubuntu laptop.

What should I do to support this specific hardware connected on the hdmi port of the iot-gate-imx8plus ?

Joel

vraevsky commented 3 months ago

Hello,

Please try this: https://github.com/compulab-yokneam/Documentation/blob/master/etc/howto/edid.md

joelguittet commented 3 months ago

Hello @vraevsky

Thanks for the quick reply to this issue.

I tried several things about EDID but at the end I'm not sure the issue is there because of the following reasons:

root@iot-gate-imx8plus:~# cat /sys/class/drm/card1-HDMI-A-1/enabled  
disabled
root@iot-gate-imx8plus:~# cat /sys/class/drm/card1-HDMI-A-1/status  
disconnected
root@iot-gate-imx8plus:~# eeprom-util read 6 0x50
Unknown layout. Dumping raw data
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f     0123456789abcdef
00: 00 ff ff ff ff ff ff 00 39 04 4f 07 00 00 00 00     ........9?O?....
10: 01 11 01 03 80 0f 09 00 0a 00 00 00 00 00 00 00     ???????.?.......
20: 00 00 00 00 00 00 01 01 01 01 01 01 01 01 01 01     ......??????????
30: 01 01 01 01 01 01 80 0c 20 80 30 e0 2d 10 28 30     ???????? ?0?-?(0
40: d3 00 9a 56 00 00 00 18 00 00 00 fc 00 4e 48 44     ?.?V...?...?.NHD
50: 2d 37 2e 30 20 48 44 4d 49 0a 00 00 00 10 00 00     -7.0 HDMI?...?..
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10     ...............?
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fb     ...............?
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................
root@iot-gate-imx8plus:~# 
root@iot-gate-imx8plus:~# get-edid -b 6 | parse-edid 
6
This is read-edid version 3.0.2. Prepare for some fun.
Attempting to use i2c interface
Only trying 6 as per your request.
256-byte EDID successfully retrieved from i2c bus 6
Looks like i2c was successful. Have a good day.
Checksum Correct

Section "Monitor"
        Identifier "NHD-7.0 HDMI"
        ModelName "NHD-7.0 HDMI"
        VendorName "NHD"
        # Monitor Manufactured week 1 of 2007
        # EDID version 1.3
        # Digital Display
        DisplaySize 150 90
        Gamma 1.00
        Option "DPMS" "false"
        Modeline        "Mode 0" -hsync -vsync 
EndSection

Note I have previously verified i2c bus number associated to this HDMI output:

root@iot-gate-imx8plus:~# ls -l /sys/class/drm/card1-HDMI-A-1/ddc
lrwxrwxrwx 1 root root 0 Jul  1 16:02 /sys/class/drm/card1-HDMI-A-1/ddc -> ../../../../soc@0/30c00000.bus/32fd8000.hdmi/i2c-6

I also used modetest:

root@iot-gate-imx8plus:~# modetest -M imx-drm
Encoders:
id      crtc    type    possible crtcs  possible clones
34      0       TMDS    0x00000001      0x00000001

Connectors:
id      encoder status          name            size (mm)       modes   encoders
35      0       disconnected    HDMI-A-1        0x0             0       34
...

So I think there should be no issue to read EDID data from the screen itself (and so specifying the EDID data manually will not help), but instead the screen get disabled for a reason I don't know.

I have grep the dmesg output but not sure it helps:

root@iot-gate-imx8plus:~# dmesg | grep -i hdmi
[    0.083274] platform 32fd8000.hdmi: Fixing up cyclic dependency with 32fc6000.lcd-controller
[    2.818371] dwhdmi-imx 32fd8000.hdmi: Detected HDMI TX controller v2.13a with HDCP (samsung_dw_hdmi_phy2)
[    2.828401] dwhdmi-imx 32fd8000.hdmi: registered DesignWare HDMI I2C bus driver
[    2.844621] imx-drm display-subsystem: bound 32fd8000.hdmi (ops dw_hdmi_imx_ops)
[    9.423133] imx-hdmi sound-hdmi: snd_soc_register_card failed (-517)
[    9.468391] input: audio-hdmi HDMI Jack as /devices/platform/sound-hdmi/sound/card0/input1
[    9.480269] evbug: Connected device: input1 (audio-hdmi HDMI Jack at ALSA)
root@iot-gate-imx8plus:~# dmesg | grep -i drm                                                                                                                                                              
[    1.844239] [drm] Initialized vivante 1.0.0 20170808 for 40000000.mix_gpu_ml on minor 0
[    2.836606] imx-drm display-subsystem: bound imx-lcdifv3-crtc.0 (ops lcdifv3_crtc_ops)
[    2.844621] imx-drm display-subsystem: bound 32fd8000.hdmi (ops dw_hdmi_imx_ops)
[    2.852245] [drm] Initialized imx-drm 1.0.0 20120507 for display-subsystem on minor 1
[    2.860142] imx-drm display-subsystem: [drm] Cannot find any crtc or sizes
[    6.216505] systemd[1]: Starting Load Kernel Module drm...
[    6.468198] systemd[1]: modprobe@drm.service: Deactivated successfully.
[    6.477416] systemd[1]: Finished Load Kernel Module drm.

I also tried connecting the iot-gate-imx8plus to a standard screen, this is working properly. Is it possible EDID data from the screen are read and system is disabling the HDMI output because of some incompatibilities or kernel configuration missing ?

Thanks for your experience on this! Joel

vraevsky commented 3 months ago

Hello @joelguittet

Try this out: 1)Take the EDID snapshot binary from a working system. 2)Copy it to /lib/firmware/edid/edib.bin 3)Make the system ignore the in-panel edid and set it “:e output forced to on” Read this also: https://github.com/compulab-yokneam/Documentation/wiki/iMX8M-HDMI

Regards, Val.

joelguittet commented 3 months ago

Hello @vraevsky

Thanks! Seems this help. I'm testing several cmdline parameters and also added edid.bin. I get an error from weston: "no available modes for HDMI-A-1" and weston fails to start. Is it something you already know ? This provide only some few results while googling this sentence... I'm trying to look in parallel of course and already notice /sys/class/drm/card1-HDMI-A-1/modes is empty which I suspect to be the issue.

Joel

joelguittet commented 3 months ago

@vraevsky note I'm wondering about the support of such display on the iot-gate-imx8plus because the reference manual of the imx8plus available from NXP indicates the following on page 17:

• HDMI 2.0a
    • HDMI 2.0a Tx supporting one display
        • Resolutions of: 740x480p60, 720x480p60, 1280x720p60, 1920x1080p60, 1920x1080p120, 3840x2160p30

Do you know if you at compulab or one customer successfully to use another screen resolution not mentioned in the NXP reference's manual ?

vraevsky commented 3 months ago

Hello @joelguittet

Please have a look at what we have with other customers:

Support ticket with an unknown status, could be a success)

Quotation: The issue could be with the pixel clock. 1) Try these setting 1-st; 40 Hz) video=disp.screen0_output_mode=EDID:0 video=HDMI-A-1:800x480@40 50 Hz) video=disp.screen0_output_mode=EDID:0 video=HDMI-A-1:800x480@50 60 Hz) video=disp.screen0_output_mode=EDID:0 video=HDMI-A-1:800x480@60 2) If neither on these setting work, then generate a custom edid. 3) If step (2) does not work either, then the assigned-clcok-rates of lcdif3 or hdmi must be changed. https://github.com/compulab-yokneam/linux-compulab/blob/linux-compulab_v5.15.71/arch/arm64/boot/dts/freescale/imx8mp.dtsi#L1963 https://github.com/compulab-yokneam/linux-compulab/blob/linux-compulab_v5.15.71/arch/arm64/boot/dts/freescale/imx8mp.dtsi#L2005

Another customer success story with these settings:

1) CONFIG_DRM_LOAD_EDID_FIRMWARE is on with the attached edid/edid.bin to the the kernel binary. CONFIG_EXTRA_FIRMWARE="edid/edid.bin" CONFIG_EXTRA_FIRMWARE_DIR="lib/firmware" CONFIG_DRM_LOAD_EDID_FIRMWARE=y CONFIG_FIRMWARE_EDID=y 2) Add the video parameter to bootargs 'video=HDMI-A-1:D' 3) /etc/X11/xorg.conf.d/99-display.conf Monitor section: a cusstomer reply) quotation: With our dispays from Newhaven and the new Debian 12 image the working modelines are a follows: Modeline "800x480" 40 800 816 896 992 480 481 484 497 +hsync +vsync Modeline "1024x600" 40 1024 1056 1336 1368 600 611 620 631 +hsync +vsync Both use a 40Mhz pixelclock, resulting in a slightly overdriven 4,3" display and underdriven 7" display.

Regards, Valentin.

vraevsky commented 3 months ago

The very helpfull manual: https://wiki.archlinux.org/title/kernel_mode_setting

joelguittet commented 2 months ago

Hello, Just a follow up here, EDID and kernel parameters was not the correct way. No need to change them. Instead the support of HDMY PHY specific clock is required and not initially supported by linux-imx. See: https://community.nxp.com/t5/i-MX-Processors/Specific-HDMI-screen-resolution-quot-hdmi-phy-quot-clock-remains/m-p/1909691 Closing the issue. Joel