Run QT application on headless imx8m mini (weston does not start)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Run QT application on headless imx8m mini (weston does not start)

6,891 次查看
walid
Contributor II

Hello,

We are trying to run qt application (uses opengl) on headless i.MX 8M Mini LPDDR4 EVK Board (without any display plugged).

We are using yocto warrior version: imx-linux-warrior ( imx-4.19.35-1.1.0), xwayland distro, and the full qt5 image fsl-image-qt5-validation-imx

DISTRO=fsl-imx-xwayland MACHINE=imx8mmlpddr4evk source fsl-setup-release.sh -b build-xwayland

bitbake fsl-image-qt5-validation-imx

If the mipi dsi to hdmi converter is plugged (it does not matter if hdmi display is plugged or not), weston starts and the qt app can use opengl.

If the mipi dsi to hdmi converter is unplugged, weston does not start (no drm device found error). if weston does not start the qt application does not work.

If I remove the adv7535 from the imx8m mini evk dts in the &mipi_dsi section:

 port@1 {
 dsim_to_adv7535: endpoint {
 remote-endpoint = <&adv7535_from_dsim>;
 };
 };

It does not work either. We don't even have /dev/dri/card0.

We have a custom board without the dsi to hdmi converter and we are facing the same issue as described on the eval board.

Do you have any ideas on how to solve this issue ?

Thank you,

Walid

0 项奖励
回复
5 回复数

6,837 次查看
walid
Contributor II

Hello, I downloaded the latest bsp 5.4.70. We are facing the same issue, weston does not start if no device is connected to the MIPI DSI interface of the evk board.

Here are weston logs when no display is connected

root@imx8mmlpddr4evk:~# weston-launch -t /dev/tty7 -u root -v
weston-launch: spawned weston with pid: 843
Date: 2021-01-04 UTC
[15:03:01.778] weston 9.0.0
https://wayland.freedesktop.org
Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
Build: 9.0.0-34-ga1823f20+
[15:03:01.778] Command line: /usr/bin/weston
[15:03:01.778] OS: Linux, 5.4.70-2.3.0+g4f2631b022d8, #1 SMP PREEMPT Mon Jan 4 15:10:01 UTC 2021, aarch64
[15:03:01.779] Using config file '/etc/xdg/weston/weston.ini'
[15:03:01.779] Output repaint window is 16 ms maximum.
[15:03:01.779] Loading module '/usr/lib/libweston-9/drm-backend.so'
[15:03:01.785] initializing drm backend
[15:03:01.785] logind: failed to get session seat
[15:03:01.785] logind: cannot setup systemd-logind helper (-61), using legacy fallback
weston-launch: opened /dev/dri/card0: ret: 0, fd: 6
weston-launch: opened /dev/dri/card1: ret: 0, fd: 8
[15:03:01.789] no drm device found
[15:03:01.789] fatal: failed to create compositor backend
Internal warning: debug scope 'drm-backend' has not been destroyed.

 

I tried using vkms (seems to be the thing to do according to vkms description) but it does not work either, here are the logs

root@imx8mmlpddr4evk:~# weston-launch -t /dev/tty7 -u root -v
weston-launch: spawned weston with pid: 569
Date: 2021-01-04 UTC
[14:37:10.332] weston 9.0.0
https://wayland.freedesktop.org
Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
Build: 9.0.0-34-ga1823f20+
[14:37:10.332] Command line: /usr/bin/weston
[14:37:10.332] OS: Linux, 5.4.70-2.3.0+g4f2631b022d8, #1 SMP PREEMPT Mon Jan 4 15:10:01 UTC 2021, aarch64
[14:37:10.332] Using config file '/etc/xdg/weston/weston.ini'
[14:37:10.333] Output repaint window is 16 ms maximum.
[14:37:10.333] Loading module '/usr/lib/libweston-9/drm-backend.so'
[14:37:10.338] initializing drm backend
[14:37:10.339] logind: failed to get session seat
[14:37:10.339] logind: cannot setup systemd-logind helper (-61), using legacy fallback
weston-launch: opened /dev/dri/card1: ret: 0, fd: 6
weston-launch: opened /dev/dri/card2: ret: 0, fd: 8
weston-launch: opened /dev/dri/card0: ret: 0, fd: 9
[14:37:10.345] using /dev/dri/card0
[14:37:10.346] DRM: supports atomic modesetting
[14:37:10.346] DRM: does not support GBM modifiers
[14:37:10.346] DRM: supports picture aspect ratio
[14:37:10.346] Loading module '/usr/lib/libweston-9/g2d-renderer.so'
weston-launch: opened /dev/input/event1: ret: 0, fd: 10
[14:37:10.366] event1 - gpio_ir_recv: is tagged by udev as: Keyboard Pointingstick
[14:37:10.367] event1 - gpio_ir_recv: device is a pointer
[14:37:10.367] event1 - gpio_ir_recv: device is a keyboard
weston-launch: opened /dev/input/event0: ret: 0, fd: 11
[14:37:10.371] event0 - 30370000.snvs:snvs-powerkey: is tagged by udev as: Keyboard
[14:37:10.372] event0 - 30370000.snvs:snvs-powerkey: device is a keyboard
[14:37:10.395] libinput: configuring device "gpio_ir_recv".
[14:37:10.395] libinput: configuring device "30370000.snvs:snvs-powerkey".
[14:37:10.396] DRM: head 'Virtual-1' found, connector 33 is connected, EDID make 'unknown', model 'unknown', serial 'unknown'
[14:37:10.396] Registered plugin API 'weston_drm_output_api_v1' of size 24
[14:37:10.396] drm_output_init_g2d failed.
[14:37:10.396] Failed to init output g2d state
[14:37:10.397] Enabling output "Virtual-1" failed.
[14:37:10.397] Error: cannot enable output 'Virtual-1' without heads.
[14:37:10.397] event1 - gpio_ir_recv: device removed
[14:37:10.397] event0 - 30370000.snvs:snvs-powerkey: device removed

 

I also tried to disable g2d in weston config file (using vkms), here are the logs

root@imx8mmlpddr4evk:~# weston-launch -t /dev/tty7 -u root -v
weston-launch: spawned weston with pid: 587
Date: 2021-01-04 UTC
[14:38:21.766] weston 9.0.0
https://wayland.freedesktop.org
Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
Build: 9.0.0-34-ga1823f20+
[14:38:21.766] Command line: /usr/bin/weston
[14:38:21.766] OS: Linux, 5.4.70-2.3.0+g4f2631b022d8, #1 SMP PREEMPT Mon Jan 4 15:10:01 UTC 2021, aarch64
[14:38:21.766] Using config file '/etc/xdg/weston/weston.ini'
[14:38:21.767] Output repaint window is 16 ms maximum.
[14:38:21.767] Loading module '/usr/lib/libweston-9/drm-backend.so'
[14:38:21.773] initializing drm backend
[14:38:21.773] logind: failed to get session seat
[14:38:21.773] logind: cannot setup systemd-logind helper (-61), using legacy fallback
weston-launch: opened /dev/dri/card1: ret: 0, fd: 6
weston-launch: opened /dev/dri/card2: ret: 0, fd: 8
weston-launch: opened /dev/dri/card0: ret: 0, fd: 9
[14:38:21.779] using /dev/dri/card0
[14:38:21.779] DRM: supports atomic modesetting
[14:38:21.779] DRM: does not support GBM modifiers
[14:38:21.779] DRM: supports picture aspect ratio
[14:38:21.781] Loading module '/usr/lib/libweston-9/gl-renderer.so'
[14:38:21.791] EGL client extensions: EGL_EXT_client_extensions
EGL_EXT_platform_base EGL_KHR_platform_wayland
EGL_EXT_platform_wayland EGL_KHR_platform_gbm
[14:38:21.794] EGL version: 1.5
[14:38:21.794] EGL vendor: Vivante Corporation
[14:38:21.794] EGL client APIs: OpenGL_ES OpenVG
[14:38:21.794] EGL extensions: EGL_KHR_fence_sync EGL_KHR_reusable_sync
EGL_KHR_wait_sync EGL_KHR_image EGL_KHR_image_base
EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image
EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image
EGL_EXT_image_dma_buf_import
EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_lock_surface
EGL_KHR_create_context EGL_KHR_no_config_context
EGL_KHR_surfaceless_context EGL_KHR_get_all_proc_addresses
EGL_EXT_buffer_age EGL_ANDROID_native_fence_sync
EGL_WL_bind_wayland_display
EGL_WL_create_wayland_buffer_from_image EGL_KHR_partial_update
EGL_EXT_swap_buffers_with_damage
EGL_KHR_swap_buffers_with_damage EGL_EXT_pixel_format_float
[14:38:21.795] EGL_KHR_surfaceless_context available
[14:38:21.807] GL version: OpenGL ES 2.0 V6.4.3.p1.305572
[14:38:21.807] GLSL version: OpenGL ES GLSL ES 1.0.0
[14:38:21.807] GL vendor: Vivante Corporation
[14:38:21.807] GL renderer: Vivante GC7000NanoUltra
[14:38:21.807] GL extensions: GL_OES_vertex_half_float
GL_OES_element_index_uint GL_OES_mapbuffer
GL_OES_vertex_array_object GL_OES_compressed_ETC1_RGB8_texture
GL_OES_compressed_paletted_texture GL_OES_texture_npot
GL_OES_rgb8_rgba8 GL_OES_depth_texture
GL_OES_depth_texture_cube_map GL_OES_depth24 GL_OES_depth32
GL_OES_packed_depth_stencil GL_OES_fbo_render_mipmap
GL_OES_get_program_binary GL_OES_fragment_precision_high
GL_OES_standard_derivatives GL_OES_EGL_image
GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3
GL_OES_EGL_sync GL_OES_required_internalformat
GL_OES_surfaceless_context GL_OES_texture_border_clamp
GL_EXT_texture_type_2_10_10_10_REV
GL_EXT_texture_compression_dxt1 GL_EXT_texture_format_BGRA8888
GL_EXT_texture_compression_s3tc GL_EXT_read_format_bgra
GL_EXT_multi_draw_arrays GL_EXT_frag_depth
GL_EXT_discard_framebuffer GL_EXT_blend_minmax
GL_EXT_multisampled_render_to_texture GL_EXT_robustness
GL_EXT_texture_sRGB_decode GL_EXT_texture_border_clamp
GL_EXT_texture_rg GL_VIV_direct_texture
[14:38:21.807] GL ES 2 renderer features:
read-back format: BGRA
wl_shm sub-image to texture: no
EGL Wayland extension: yes
weston-launch: opened /dev/input/event1: ret: 0, fd: 10
[14:38:21.817] event1 - gpio_ir_recv: is tagged by udev as: Keyboard Pointingstick
[14:38:21.818] event1 - gpio_ir_recv: device is a pointer
[14:38:21.818] event1 - gpio_ir_recv: device is a keyboard
weston-launch: opened /dev/input/event0: ret: 0, fd: 11
[14:38:21.822] event0 - 30370000.snvs:snvs-powerkey: is tagged by udev as: Keyboard
[14:38:21.822] event0 - 30370000.snvs:snvs-powerkey: device is a keyboard
[14:38:21.846] libinput: configuring device "gpio_ir_recv".
[14:38:21.846] libinput: configuring device "30370000.snvs:snvs-powerkey".
[14:38:21.847] DRM: head 'Virtual-1' found, connector 33 is connected, EDID make 'unknown', model 'unknown', serial 'unknown'
[14:38:21.847] Registered plugin API 'weston_drm_output_api_v1' of size 24
[ 1] DRM_IOCTL_PRIME_FD_TO_HANDLE failed (fd=24)
[ 2] ioctl(DRM_IOCTL_GEM_CLOSE) failed
[ 3] DRM_IOCTL_PRIME_FD_TO_HANDLE failed (fd=24)
[ 4] ioctl(DRM_IOCTL_GEM_CLOSE) failed
[14:38:22.203] failed to create gbm surface
[14:38:22.203] Failed to init output gl state
[14:38:22.203] Enabling output "Virtual-1" failed.
[14:38:22.203] Error: cannot enable output 'Virtual-1' without heads.
[14:38:22.204] event1 - gpio_ir_recv: device removed
[14:38:22.204] event0 - 30370000.snvs:snvs-powerkey: device removed

Do you have any idea on how to solve this issue ?

Thank you,

Walid

0 项奖励
回复

6,880 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello walid,

I would recommend that you download the latest L5.4.47 BSP documentation on  the link below (you may need to login to download this file) where yocto work normally.

 

https://www.nxp.com/webapp/Download?colCode=L5.4.47_2.0.0_LINUX_DOCS

 

Inside, you will find the i.MX Yocto Project User Guide, which explains how to setup Yocto and use Bitbake. Bitbake is used to build images for your board so in your case this is already done as you used one of the available prebuilt images.

 

If you want to run Qt5 applications, you may do so from the image you have loaded on the board. However, you would need the Qt5 toolchain to cross compile for Qt5. You can find more information on this on the BSP documentation.

As for development for Qt5, it is not supported by the BSP but you may find the resources for Qt Creator useful:

https://www.qt.io/product

The toolchain is provided as part of the BSP Releases. You may find the available Linux BSPs on the following link:

https://www.nxp.com/design/software/embedded-software/linux-software-and-development-tools/embedded-...

 

Inside of the BSP Release documentation you may find the i.MX Porting Guide. Please follow the instructions on Chapter 2 of this document. The command would look something like:

DISTRO=<DISTRO> MACHINE=<TARGET_MACHINE> bitbake  <IMAGE> -c populate_sdk

 

I hope this helps!

 

 

0 项奖励
回复

6,875 次查看
walid
Contributor II

Hello,

Thank you for the reply. I think I have not been very clear.

We already built our qt app and its working on the eval board when the display is connected, It does not work when no display is connected.

In more simple words, the issue here is to start weston when no device is connected to the MIPI DSI interface. No opengl rendering is available if weston does not start since eglfs is not supported on imx8. 

We actually need opengl even if no display is connected. I hope its more clear.

Thank you,

Walid

6,163 次查看
scalvi
Contributor I

Hi Walid,

 

I'm having the same issue, did you guys figure it out how to launch weston with no monitor?

0 项奖励
回复

6,145 次查看
walid
Contributor II

Hi Scalvi,

Unfortunately without any help from NXP, we only managed to find a workaround, declare Raydium panel in the device tree.

The panel is not connected. It is just to be able to start weston and make
opengl available.

If you're able to find a better solution please let me know. Thank you

&lcdif {
 status = "okay";
};

&mipi_dsi {
 status = "okay";

 panel@0 {
 compatible = "raydium,rm67191";
 reg = <0>;
 pinctrl-0 = <&pinctrl_mipi_dsi_en>;
 reset-gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>;
 dsi-lanes = <4>;//4,2
 video-mode = <2>; /* 0: burst mode
 * 1: non-burst mode with sync event
 * 2: non-burst mode with sync pulse
 */
 panel-width-mm = <37>;//68,37
 panel-height-mm = <65>;//121,65
 status = "okay";
 };
};

0 项奖励
回复