Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mesa: update to 24.3.1 #1390

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BassemMohsen
Copy link

@BassemMohsen BassemMohsen commented Nov 17, 2024

Update to latest mesa 24.3.1 release
Fixes DRAM DSI linking to missing library drm-rp1-dsi_dri.so

fixes #1389

  • Added new dependencies required by msea version update.
  • Removed DRI3 option as it's now removed from meson build options.

This PR will be completed when 24.3.1 is final official release. For now, I'm leaving it as work of progress to help whoever have issues with RPI5 DSI.

@BassemMohsen BassemMohsen force-pushed the mesa-24.3.0 branch 2 times, most recently from e4e19a9 to 8402318 Compare November 22, 2024 12:29
@BassemMohsen BassemMohsen changed the title WIP: mesa: update to 24.3.0-rc2, wayland-protocol updated to 1.38 mesa: update to 24.3.0-rc2, wayland-protocol updated to 1.38 Nov 22, 2024
@BassemMohsen
Copy link
Author

Official mesa 24.3.0 is released, bbappend is updated with official release.

This looks promising too, but let's not live too much on the edge 🗡️
I will wait for 2025.

https://www.phoronix.com/news/Linux-6.13-Big-Super-RPi-V3D

@BassemMohsen BassemMohsen changed the title mesa: update to 24.3.0-rc2, wayland-protocol updated to 1.38 mesa: update to 24.3.0, wayland-protocol updated to 1.38 Nov 22, 2024
Copy link
Contributor

@leon-anavi leon-anavi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Nice work! I tested this pull request on Raspberry Pi 5. It brings significant improvement because with it Weston uses dri_gbm.so for both the microHDMI and the DSI. I tested with the first generation of the official 7" Raspberry Pi touchscreen display.

@agherzan
Copy link
Owner

agherzan commented Dec 4, 2024

Is this work supposed to end up in oe-core?

PS: Nice work!

@BassemMohsen
Copy link
Author

Is this work supposed to end up in oe-core?

PS: Nice work!

Eventually Poky would update mesa, not sure which future version that will be.

Right now, DSI on RPI 5 with mesa from styhead with version 24.0.7 is unusable.
As mentioned in the issue linked, Mesa Loader is hardcoded to try to load drm-rp1-dsi_dri.so which doesn't exist anywhere as userland library, it fails and uses software rendering fallback softpipe instead.

So, let's say this PR can live to help anyone wants to use DSI with RP1 chip on RaspberryPi 5

drm-rp1-dsi_dri.so exists in Raspbian os, I have no clue where did Raspbian os obtain such blob.
One could port that blob but it's much dirtier and harder to satisfy drm-rp1-dsi_dri.so dependencies from Raspbian OS, different version for LLVM, libc .. etc

@BassemMohsen
Copy link
Author

Seems build have failed due to running a test test_security:
But I can't really see that test function in Poky Styhead with the hash: 8ce494b9cf84e769ac72b201838c76fd2ff894c9

@BassemMohsen
Copy link
Author

Seems build have failed due to running a test test_security: But I can't really see that test function in Poky Styhead with the hash: 8ce494b9cf84e769ac72b201838c76fd2ff894c9

I see, RPI CI tests are ran against Poky master branch, not Styhead.

@BassemMohsen
Copy link
Author

BassemMohsen commented Dec 6, 2024

The failing test is due to new requirement added in Poky on the whole layer to have SECURITY.md file, it's not related to my recipe updates though:

        Test that the layer has a SECURITY.md (or similar) file, either in the
        layer itself or at the top of the containing git repository.

https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository

Perhaps that's something for meta-raspberrypi maintainer to do

kraj added a commit to YoeDistro/meta-raspberrypi that referenced this pull request Dec 6, 2024
@lifeisafractal
Copy link

Thank you so much for posting this! This got hardware acceleration for Weston on RPi5 w/ the official 7" display over DSI working. I'm currently on master/main for all other upstream layers (poky, meta-rpi, etc) and had to make a couple tweaks.

  • The Wayland Protocol recipe isn't needed on main as upstream Poky has gone to 1.38 already
  • I had to make a couple tweaks to the mesa bbappend. This is all likely a moot point as we are really just waiting for upstream to go to mesa 2.3.0 when it releases, but until then this is super helpful.
    • I made some tweaks to the removal of the dri3 package config option
    • the mesa-megadriver seems to make a ton of symlinks for different old libs to one new consolidated one. I'm not sure when this happened, but you need to skip dev-so to allow library symlinks in that package.
PACKAGECONFIG:append:rpi = " gallium gallium-llvm vc4 v3d ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'vulkan broadcom', '', d)}"
DRIDRIVERS:class-target:rpi = ""

# Remove unused patches
SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
           file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
"

SRC_URI[sha256sum] = "97813fe65028ef21b4d4e54164563059e8408d8fee3489a2323468d198bf2efc"
PV = "24.3.0"

# -Dglvnd is deprecated from true/false to enabled/disabled
PACKAGECONFIG[glvnd] = "-Dglvnd=enabled, -Dglvnd=disabled, libglvnd"

# DRI3 note:
# DRI3 Build option is removed from meson.
PACKAGECONFIG:remove = "dri3"
unset PACKAGECONFIG[dri3]

DEPENDS += " wayland-protocols llvm python3-pyyaml python3-pyyaml-native"

RDEPENDS:libgl-mesa += " llvm wayland-protocols"

FILES:libgbm += " ${libdir}/gbm/dri_gbm*.so"

FILES:libgl-mesa += " ${libdir}/libgallium*.so"

FILES:libgbm-dev += " ${includedir}/gbm.h"

DEPENDS += "libxshmfence"

# mesa-megadriver uses symlinks for compatibility
INSANE_SKIP:mesa-megadriver += "dev-so"

@BassemMohsen
Copy link
Author

Thank you so much for posting this! This got hardware acceleration for Weston on RPi5 w/ the official 7" display over DSI working. I'm currently on master/main for all other upstream layers (poky, meta-rpi, etc) and had to make a couple tweaks.

  • The Wayland Protocol recipe isn't needed on main as upstream Poky has gone to 1.38 already

  • I had to make a couple tweaks to the mesa bbappend. This is all likely a moot point as we are really just waiting for upstream to go to mesa 2.3.0 when it releases, but until then this is super helpful.

    • I made some tweaks to the removal of the dri3 package config option
    • the mesa-megadriver seems to make a ton of symlinks for different old libs to one new consolidated one. I'm not sure when this happened, but you need to skip dev-so to allow library symlinks in that package.
PACKAGECONFIG:append:rpi = " gallium gallium-llvm vc4 v3d ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'vulkan broadcom', '', d)}"
DRIDRIVERS:class-target:rpi = ""

# Remove unused patches
SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
           file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
"

SRC_URI[sha256sum] = "97813fe65028ef21b4d4e54164563059e8408d8fee3489a2323468d198bf2efc"
PV = "24.3.0"

# -Dglvnd is deprecated from true/false to enabled/disabled
PACKAGECONFIG[glvnd] = "-Dglvnd=enabled, -Dglvnd=disabled, libglvnd"

# DRI3 note:
# DRI3 Build option is removed from meson.
PACKAGECONFIG:remove = "dri3"
unset PACKAGECONFIG[dri3]

DEPENDS += " wayland-protocols llvm python3-pyyaml python3-pyyaml-native"

RDEPENDS:libgl-mesa += " llvm wayland-protocols"

FILES:libgbm += " ${libdir}/gbm/dri_gbm*.so"

FILES:libgl-mesa += " ${libdir}/libgallium*.so"

FILES:libgbm-dev += " ${includedir}/gbm.h"

DEPENDS += "libxshmfence"

# mesa-megadriver uses symlinks for compatibility
INSANE_SKIP:mesa-megadriver += "dev-so"

Thanks @lifeisafractal , I'm glad you found this helpful.

I was building against styhead, that's why I needed the wayland protocol receipe bump.
I could remove it and bump mesa to 24.3.1 since it's also released with some bug fixes.

Thanks for posting changes, I will adopt your changes in the main PR next week.

I see you added a new build time depends.
DEPENDS += "libxshmfence"
Why is this required if you are building for wayland/weston and not x11?

@lifeisafractal
Copy link

I could remove it and bump mesa to 24.3.1 since it's also released with some bug fixes.

Thanks for the heads up on 24.3.1. I'll bump to that in my local layer to be on a released version.

I see you added a new build time depends.
DEPENDS += "libxshmfence"
Why is this required if you are building for wayland/weston and not x11?

That was originally brought in as a dependency through the dri3 packageconfig setup, which was removed. To be honest, I'm not sure why it was required in the build, I was getting a meson build config error on it missing, so I added it. I didn't dig any deeper once I got things building. If I look deeper into it and find anything I'll report back here.

@leon-anavi
Copy link
Contributor

@BassemMohsen your patch applies clearly on Scarthgap and works fine. I've tested in today. Congrats again for the great work!

Do you plan to open a GitHub pull request for branch scarthgap? I need this and if you don't have the time I will be happy to open it for you.

@BassemMohsen
Copy link
Author

@BassemMohsen your patch applies clearly on Scarthgap and works fine. I've tested in today. Congrats again for the great work!

Do you plan to open a GitHub pull request for branch scarthgap? I need this and if you don't have the time I will be happy to open it for you.

A bit busy with some CES demos this week.

Sure, I will open a new PR for Scarthgap this Saturday.
also update the PR with all the comments and to the new minor mesa release 24.3.1

can also base it on top of PR #1391 that adds SECURITY.md file, so it passes all the CI checks.

agherzan pushed a commit that referenced this pull request Dec 12, 2024
@agherzan agherzan marked this pull request as draft December 12, 2024 22:52
daregit pushed a commit to daregit/yocto-combined that referenced this pull request Dec 12, 2024
…rity issues

Fixes Issues like agherzan/meta-raspberrypi#1390 (comment)

Signed-off-by: Khem Raj <raj.khemgmail.com>
daregit pushed a commit to daregit/yocto-combined that referenced this pull request Dec 13, 2024
…rity issues

Fixes Issues like agherzan/meta-raspberrypi#1390 (comment)

Signed-off-by: Khem Raj <raj.khemgmail.com>
@BassemMohsen BassemMohsen changed the title mesa: update to 24.3.0, wayland-protocol updated to 1.38 mesa: update to 24.3.1, wayland-protocol updated to 1.38 Dec 14, 2024
@BassemMohsen BassemMohsen marked this pull request as ready for review December 14, 2024 14:40
@BassemMohsen
Copy link
Author

Pumped mesa to latest and greatest.
Rebased on latest master branch to fix CI check for SECURITY.md

daregit pushed a commit to daregit/yocto-combined that referenced this pull request Dec 17, 2024
…rity issues

Fixes Issues like agherzan/meta-raspberrypi#1390 (comment)

Signed-off-by: Khem Raj <raj.khemgmail.com>
Upgrade to latest official mesa release.

Fixes DRM DSI linking to missing and non exisiting library
drm-rp1-dsi_dri.so on mesa 24.0.7 from poky scarthgap
and styhead.

    agherzan#1389

Signed-off-by: Bassem Nomany <[email protected]>
@BassemMohsen BassemMohsen changed the title mesa: update to 24.3.1, wayland-protocol updated to 1.38 mesa: update to 24.3.1 Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RPI5 MIPI Display Serial Interface DRI fails to load in mesa
4 participants