1

I made a small linux distro to use on my projects involving an orange pi one H3, but the HDMI output never works

To know if the device was supported by the linux kernel, i tested another distro (armbian), which worked fine. With that in mind, i tried to change my kernel config based on their, adding every relevant feature, but my version was still not working

I decided to take a look at dmesg after every try, and found that there's one error that i can't get rid of

[    0.827899] sun4i-drm display-engine: bound 1100000.mixer (ops 0xc0851c2c)
[    0.835081] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc084e2dc)
[    0.842821] sun8i-dw-hdmi 1ee0000.hdmi: supply hvcc not found, using dummy regulator
[    0.851453] sun8i-dw-hdmi 1ee0000.hdmi: Detected HDMI TX controller v1.32a with HDCP (sun8i_dw_hdmi_phy)
[    0.861330] sun8i-dw-hdmi 1ee0000.hdmi: registered DesignWare HDMI I2C bus driver
[    0.869108] sun4i-drm display-engine: bound 1ee0000.hdmi (ops 0xc0851228)
[    0.875927] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    0.882941] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[    0.995934] random: fast init done
[    1.001697] sun4i-drm display-engine: [drm] *ERROR* fbdev: Failed to setup generic emulation (ret=-12)
[    1.013330] lima 1c40000.gpu: gp - mali400 version major 1 minor 1

I couldn't find anything useful about this specific error on the internet, and i couldn't find the explanation for the return code on the kernel source, what could i do to try to fix that problem?

I'm using

- Linux version 5.8.13 (arm-linux-musleabihf-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35)
- No modules, no initrd/initramfs
- Machine model: Xunlong Orange Pi One
- U-boot (orangepi_one_defconfig)
3
  • I found the error on drivers/gpu/drm/drm_fb_helper.c (line 2192). Going inside the functions, i realized that -12 probably means -ENOMEM, if that's the case, it's being returned by drm_file_alloc on a failed kzalloc Oct 26 '20 at 18:37
  • After debugging, turned out that it wasn't this function, and sometimes randomly i get other error instead ([drm] cannot find any crtc or sizes), which i can fix by hardcoding a size (and successfully managing to make the hdmi output work), but i don't know what makes it appear instead of the error i described before, this happens only on some reboots, but i remember appearing more often when i tried to use modules Oct 27 '20 at 5:20
  • I noticed that the "crtc or sizes" error was consistent with the TV turned off, and it always worked if i hardcoded the resolution and turned the device before the tv. I was thinking about using it like that, but because of this, i noticed as well that, if i hardcode my TV max resolution (4K), it didn't work with same error as before.The error was truly ENOMEM due to the high resolution, and i will try to figure out how the armbian kernel config manages to work with it Oct 30 '20 at 19:04
1

This error is an ENOMEM (out of memory error), because CMA size needs to be bigger than one raw frame of the resolution that the display will use

1920x1080 32bpp needs about 8MB, and the default is 16MB so it was working, but 3840x2160 32bpp needs a bit more than 32MB

Armbian changes the default size to 128M on the kernel configuration, using CONFIG_CMA_SIZE_MBYTES=128

But setting CMA size to 64M with the bootarg cma=64M, made it work without any patch or change in configuration

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.