agherzan / meta-raspberrypi

Yocto/OE BSP layer for the Raspberry Pi boards
https://www.yoctoproject.org/
MIT License
544 stars 416 forks source link

RPI5 MIPI Display Serial Interface DRI fails to load in mesa #1389

Open BassemMohsen opened 2 days ago

BassemMohsen commented 2 days ago

Current setup: Scargarth/Styhead: Raspberry Pi 5, Qt6.8 Demo MIPI DSI: Waveshare 8.8" with the following Device Tree Overlay dtoverlay=vc4-kms-v3d dtoverlay=vc4-kms-dsi-waveshare-panel,8_0_inch

Problem observation: When running, Qt6 QML UI demo, MESA-LOADER fails to load a library with the following error: MESA-LOADER: failed to open drm-rp1-dsi: /usr/lib/dri/drm-rp1-dsi_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri, suffix _dri) Mesa uses software rendering softpipe as a fallback of V3D failure. Qt6 UI performance is very sluggish and poor due to software rendering.

Hashes used: meta-raspberrypi: 1aeda3f52a0cb7e9e2ae3a4673c36ca8c0c70241 poky: 8ce494b9cf84e769ac72b201838c76fd2ff894c9 meta-openembedded: 461d85a1831318747af5abe86da193bcde3fd9b4 meta-qt6: 5bf5b55c458c06ff8a037b2508ebe0cb4011dc76

I expected Broadcom Renderer V3D to be used as Qt backend renderer and not softpipe.

Additional info: HDMI works well and use the correct V3D renderer since it doesn't require mesa to load rp1-dsi_dri. The library drm-rp1-dsi_dri.so on Raspbian OS bookworm but doesn't exist anywhere else, I couldn't find any sources to build it.


Solution attempt #1: I tried porting drm-rp1-dsi_dri.so as binary blob from Raspbian, but it had older llvm, libsensors.. etc dependencies that's harder to satisfy. Solution attempt #1 : Fail.

Solution attempt #2: I updated mesa to latest and greatest: 24.3.0-rc2 with the following dependencies added: Build deps: wayland-protocols llvm python3-pyyaml python3-pyyaml-native Runtime deps: llvm wayland-protocols Packageconfig -= dri3 packageconfig += gallium-llvm

Solution attempt #2 was a success. Now mesa-loader doesn't complain about missing library anymore and drm doesn't reference that library. Qt6 Demo works with full performance, very responsive and RP1 DSI works flawlessly.

Action point: If you deem my solution useful to upstream, I'm happy to create Pull Request.

BassemMohsen commented 10 hours ago

Added PR: https://github.com/agherzan/meta-raspberrypi/pull/1390