Skip to content

mesa 1:26.2.4-1.5: build the Freedreno Gallium driver for Adreno phones - #500

Open
quatrixone wants to merge 1 commit into
derekross:mainfrom
quatrixone:mesa-freedreno
Open

quatrixone wants to merge 1 commit into
derekross:mainfrom
quatrixone:mesa-freedreno

Conversation

@quatrixone

@quatrixone quatrixone commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add Gallium Freedreno to the shared Mesa build. [omamobile] precedes Arch Linux ARM in every phone's pacman repository order, so this package replaces ALARM's Mesa on Qualcomm phones too; it must ship msm_dri.so for Adreno. The Mi 8 port remains in progress. The Pixel Panfrost/Panthor path is unchanged; the maintainer plans to check Panthor on a Pixel 7 Pro before merging.

Build evidence

  • The earlier scoped Dipper package built successfully for aarch64 from commit 83aa88ec413644dfc2336e6d09ee0a06481edd01; its SHA-256 is 6122aec6efa24194c5dca9733fd8a8936d92e8c99058f9c96d7cb0eb83b8a7fc. pacman -Qlp confirmed /usr/lib/dri/msm_dri.so and the matching versioned libgallium library.
  • That scoped recipe selected freedreno,panfrost,llvmpipe,softpipe,zink, the same effective Gallium list now in the shared recipe. The shared packages/mesa recipe built successfully for aarch64 with tools/build-packages --local dipper --force packages/mesa (132 minutes). Its PKGBUILD SHA-256 is b7c8fed85586c3f1947d5400e4f506f8ab482ddd326fddbb1a6135d93c0faed1; the shared package SHA-256 is 774f3b799c6e0aea91f61fea2b7991af742e0a6e4fc9511491dba1b04219872b.
  • pacman -Qlp on the shared package confirmed /usr/lib/dri/msm_dri.so and /usr/lib/libgallium-26.2.4-arch1.1.5.omamobile5.so.

Mi 8 evidence and limits

  • On 2026-11-13, the earlier scoped package was extracted to tmpfs on the phone's pre-existing userdata Linux root and exercised from a console login with eglinfo -p gbm. OpenGL core, compatibility and ES reported freedreno / FD630; LD_DEBUG=libs confirmed that package's libgallium and dri_gbm.so loaded. This was not a Hyprland test and the package was not installed to the root.
  • a630_sqe.fw was owned by linux-firmware-qcom 20260916-1; a630_zap.mbn came from the phone's own vendor firmware, extracted and reassembled outside the repository. No vendor blob is committed.
  • The raw eglinfo and tools/phone-smoke --json outputs, exact kernel release, boot-image SHA-256 and kernel source revision for this console test were not retained. The contemporaneous smoke summary says the GPU render node and display passed, while its session check reported Hyprland and the shell were not running. Do not treat this as a Hyprland or reproducible boot-image validation.
  • The test package was extracted to tmpfs only; no package installation or UFS write was performed for this Mesa check.

The Pixel 7 Pro Panthor check remains with the maintainer.

@derekross

Copy link
Copy Markdown
Owner

Thanks for splitting the Mi 8 work into reviewable pieces, and for saying
plainly in the description what you did and didn't run. That made this one
easy to read.

The change looks right to me, and it's needed. [omamobile] sits before
Arch Linux ARM's repositories in every phone's pacman.conf, so our Mesa
replaces ALARM's on a Qualcomm phone too, and without Freedreno the Mi 8 would
have no msm_dri.so. I checked the Pixel side in the 26.2.4 tarball. kmsro
picks the Gallium driver by the render node's kernel driver name (msm for
Freedreno, panfrost/panthor for Panfrost), and Freedreno adds no build
dependency beyond libdrm, so the Pixels' path stays as it is. ALARM's
vulkan-freedreno depends on vulkan-mesa-implicit-layers, which we ship, and
not on an exact Mesa version, so your README note holds.

What it still needs before it can merge is evidence, because it rebuilds the
GPU stack on every phone and CI never builds Mesa:

  1. A build: the log of tools/build-packages --local dipper packages/mesa,
    and pacman -Qlp on the result showing msm_dri.so.
  2. The Mi 8: with that package installed, eglinfo (or glxinfo -B) showing
    the Adreno 630 renderer under Hyprland, plus the tools/phone-smoke report
    and uname -r.
  3. On my side, I'll install the same build on my Pixel 7 Pro and check that
    Panthor is still the renderer before I merge.

Small things:

  • The PKGBUILD header still says "pkgrel 1.4" (line 27).
  • The README calls the package "rebuilt for the Xiaomi Mi 8". Until the Mi 8
    port lands, I'd say "for Qualcomm Adreno phones (the Mi 8 port in progress)".
  • Please put the reason in the commit body (our Mesa wins over ALARM's, so a
    Qualcomm phone needs Freedreno in it). I'll land it as
    mesa 1:26.2.4-1.5: build the Freedreno Gallium driver for Adreno phones.

@derekross

Copy link
Copy Markdown
Owner

Thanks for the fixes, and for trying the build and saying exactly where it stopped. The PKGBUILD comment and the README wording are what I asked for.

The build is still the open point. Without it, and the Mi 8 and Pixel runs, I can't merge a change that rebuilds the GPU stack on every phone:

  1. A build. The log of tools/build-packages --local dipper packages/mesa, and pacman -Qlp on the result showing msm_dri.so. "No space left on device" while unpacking the subprojects usually means a small /tmp or Docker data directory. A Mesa build needs several GB free wherever the container works.
  2. The Mi 8. With that package installed, eglinfo (or glxinfo -B) showing the Adreno 630 renderer, plus uname -r.
  3. My Pixel 7 Pro. I'll install the same build and check that Panthor is still the renderer before I merge.

Two small things for the next push:

  • Every Mesa bump so far has moved _omamobile together with pkgrel (1.3 had omamobile3, 1.4 omamobile4). Please make it omamobile5 for 1.5, and update the comment's ".omamobile4" to match.
  • The new commit says Arch Linux ARM's Mesa doesn't include Freedreno. It does: their PKGBUILD builds -D gallium-drivers=all. The reason we need it here is that [omamobile] comes first in pacman.conf, so our Mesa replaces theirs on every phone. I'll write the squash message with that reason, so there's no need to reword it unless you're pushing anyway.

I'll land it as mesa 1:26.2.4-1.5: build the Freedreno Gallium driver for Adreno phones.

@derekross

Copy link
Copy Markdown
Owner

Thanks for both fixes. The marker now moves with pkgrel, the comment and README agree, and your new commit message gives the real reason we need our own build: [omamobile] comes first in pacman.conf, so our Mesa replaces the distribution's on every phone.

The build is still the open point, and it comes first:

  1. A build. The log of tools/build-packages --local dipper packages/mesa, and pacman -Qlp on the result showing msm_dri.so. If the last attempt ran out of space again, the container's working directory needs several GB free.
  2. The Mi 8. eglinfo or glxinfo -B showing the Adreno 630 renderer, with uname -r. That needs an Arch root on the phone, so it comes after initramfs: add guarded NFS root for bring-up #503's NFS root has run. I don't expect it before then.
  3. My Pixel 7 Pro. I'll install the same build and check that Panthor is still the renderer before I merge.

There's no hurry while the Mi 8 has no root. When it lands, the title will be mesa 1:26.2.4-1.5: build the Freedreno Gallium driver for Adreno phones.

@quatrixone

Copy link
Copy Markdown
Contributor Author

The Mesa build is now complete; the updated PR description records the 135-minute build and package hash. pacman -Qlp confirms /usr/lib/dri/msm_dri.so.

I could not complete the Mi 8 renderer check: the booted test root is generic Arch Linux ARM, has no Omarchy/Hyprland/Mesa, and exposed only simpledrm's card0, with no render node. I did not produce an eglinfo/glxinfo -B result or tools/phone-smoke report. The Pixel Panthor check remains yours.

@derekross

Copy link
Copy Markdown
Owner

Thank you for seeing the build through, 135 minutes and all. msm_dri.so in the 1.5 package is what I wanted to know, and the note about the renderer check is exactly right: a generic Arch Linux ARM root with only simpledrm's card0 can't show a renderer, so there's nothing to report yet.

Nothing more is needed from you on this PR for now. What's left:

  • My Pixel 7 Pro. I'll build the same PKGBUILD on my side (your package is signed with your local key, so I can't install that one) and check that Panthor is still the renderer.
  • The Mi 8's renderer, once it boots an Omarchy root with a render node: eglinfo or glxinfo -B with uname -r. Your panel test already showed a630_sqe.fw missing, so that firmware will be part of the same step, in the device package.

I plan to merge when the Mi 8 can actually use the driver, so the first render test can still shape this PR. The title will be mesa 1:26.2.4-1.5: build the Freedreno Gallium driver for Adreno phones.

@quatrixone
quatrixone marked this pull request as draft November 12, 2026 12:39
@quatrixone
quatrixone marked this pull request as ready for review November 12, 2026 22:07
@quatrixone quatrixone changed the title mesa: build Freedreno for Qualcomm phones mesa: add Freedreno to the Dipper build Nov 12, 2026
@derekross

Copy link
Copy Markdown
Owner

Thanks for getting a render out of the Mi 8, that's the news I was waiting for on this one. And thanks for trying to keep the Pixels' build out of it; I can see why that looked safer. I don't think the new shape works, though, and I'd like to go back to the one we had on 11-10.

The problem is that packages/mesa-freedreno-dipper builds packages with the same names and the same version as packages/mesa (mesa, vulkan-panfrost and vulkan-mesa-implicit-layers, all 1:26.2.4-1.5), with different contents:

  • tools/build-packages decides what is built by file name. I ran tools/build-packages --local dipper --list packages/mesa packages/mesa-freedreno-dipper on your head: with the shared package's three file names present in the repository (which is what importing the published packages gives you), both directories read "up to date", so your variant isn't built; with --force it is copied over the published file, and the next import copies the published one back. On my side, --all --force would put the Freedreno build into the shared repository under the shared version.
  • On the phone, the device package in device/dipper: add device runtime package #714 puts pkgs.omamobile.org first. At an equal version pacman sees nothing to do, a reinstall of mesa swaps in the build without Freedreno, and the first shared bump takes the GPU away at the next update.
  • As pushed, the shared mesa goes to 1.5 with its driver list unchanged, so every phone would download a rebuilt Mesa for nothing.

So please put freedreno back into the shared list, as your 11-09 head had it, and drop the variant directory, the two gallium-drivers files and the tools/build-packages change. One Mesa for every phone is also the only way the Mi 8 can get its driver from [omamobile] later. As I wrote on 11-08, the Pixels' path doesn't change with Freedreno built in (kmsro picks the Gallium driver by the render node's kernel driver), and I'll check Panthor on my Pixel 7 Pro before I merge. If you see a reason the shared build is wrong for the Mi 8, tell me and we'll look at it together.

For the render itself, could you add the record? The description says it rendered, and I'd like to see how:

  1. the eglinfo -B (or glxinfo -B) lines with the renderer string, and uname -r;
  2. the boot image's sha256 and the kernel it was built from. The published Dipper DTS has mdss and dispcc disabled and the panel driver is still in review (linux-omarchy-mobile device-dodge: follow-ups from #111 (fastboot refuse, install bind trap, park deliberate panic) #218), so this boot ran a kernel that is in no pull request yet; a line saying which commits were on top is enough;
  3. where a630_zap.mbn and a630_sqe.fw came from. The DTS asks for qcom/sdm845/Xiaomi/dipper/a630_zap.mbn, and no package of ours ships that;
  4. the root it ran from, and the tools/phone-smoke report you mention, pasted;
  5. which commit the tested Mesa package was built from (the 11-10 build, I assume).

A dated entry in device/dipper/NOTES.md is the right place; today's boots in #704 and #714 are other ones.

One more thing: two of the commits (7d8ba77 and b7ea824) have Codex <codex@users.noreply.github.com> as author and committer. When you rework the branch, please make yourself the author and credit the assistant with a Co-Authored-By: trailer, as CONTRIBUTING §6.3 describes (Assisted-by: is the kernel repository's form).

With the shared list back and the record in, the plan from 11-10 stands: my Panthor check, then I merge it as mesa 1:26.2.4-1.5: build the Freedreno Gallium driver for Adreno phones.

@quatrixone quatrixone changed the title mesa: add Freedreno to the Dipper build mesa 1:26.2.4-1.5: build the Freedreno Gallium driver for Adreno phones Nov 13, 2026
@quatrixone

Copy link
Copy Markdown
Contributor Author

I added the dated renderer record to device/dipper/NOTES.md in #714. It says the Mesa 1.5 archive was extracted to tmpfs in the pre-existing userdata Linux root and tested from a console; eglinfo -p gbm reported Freedreno / FD630, and LD_DEBUG=libs confirmed this package's libgallium and dri_gbm.so. It records the Mesa package commit and archive hash, a630_sqe.fw from linux-firmware-qcom, and a630_zap.mbn extracted and reassembled from the phone's own vendor firmware.

The retained evidence is incomplete: the raw eglinfo and tools/phone-smoke output, exact kernel release, boot image hash, kernel source revision and per-file firmware hashes were not retained. The contemporaneous summary says the GPU render node and display passed, but Hyprland and the shell were not running. This is not a Hyprland renderer test, and I cannot reconstruct the missing report. The new Omarchy NFS-root boot also failed to reach its test root; its missing on-device evidence is recorded in #714.

The Mesa PR is back to the shared Freedreno driver list, with the device-specific variant removed. Both current PR checks pass. The recorded Mi 8 evidence and the Pixel Panthor check are still needed before merge.

@derekross

Copy link
Copy Markdown
Owner

@quatrixone, on the design question from the last review: please go back to the shared Freedreno build we agreed on 2026-11-08 and 2026-11-10 (Freedreno added to the one mesa package, its own version bump), not a second package directory that reuses Mesa's PKGBUILD under the same name and version. Two different packages both named mesa 1:26.2.4-1.5 can't live in one repository, and the Panthor check only means something with the shared build. The other points from that review stand.

[omamobile] precedes Arch Linux ARM in every phone pacman.conf, so our Mesa
replaces their package on Qualcomm devices. Include Freedreno in the shared
build so those phones have msm_dri.so.
@quatrixone

Copy link
Copy Markdown
Contributor Author

2026-11-19 Mi 8 test attempt

I RAM-booted the Dipper panel test image (SHA-256
d9e66c36602fa4f91c372a92524b4d043d411baba5aeaf42d90435028f9a997e).
Its embedded kernel release is
7.3.0-rc6-omamobile-push1-gf61e96519032. The NFS test root contains the
shared Mesa 1:26.2.4-1.5 package and the Dipper A630 firmware.

The phone reached systemd startup, but its UFW rules blocked SSH from the USB
host. I could not run eglinfo or tools/phone-smoke, and have no renderer
result from this boot. I prepared a test-only SSH allow rule in the disposable
NFS root for a retry. No userdata or other UFS partition was written. This is
not a hardware validation pass; the Mi 8 renderer and smoke report remain open.

@quatrixone

Copy link
Copy Markdown
Contributor Author

Follow-up: second RAM boot

A second boot of the same image reached systemd and started sshd, but TCP
from the USB host still timed out, so I could not get a shell. The first-boot
keyring job was still running. No eglinfo or tools/phone-smoke result was
obtained, and this remains a failed/incomplete test, not a renderer pass.

The USB-only UFW allow rule did not restore access. I have staged disabling
UFW in the disposable NFS test root for the next boot; that change has not
taken effect in the currently running session. No UFS partition was written.

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.

2 participants