Skip to content

agx: fix the -Werror build of the AGX drivers - #2

Merged
RyanTheTide merged 3 commits into
agx3bfrom
aurora/agx-werror
Oct 11, 2026
Merged

RyanTheTide merged 3 commits into
agx3bfrom
aurora/agx-werror

Conversation

@RyanTheTide

Copy link
Copy Markdown

Fix the -Werror build of the AGX drivers

agx3b does not build with -Dwerror=true, which Mesa CI uses. GCC 16 and Clang 23 both fail:

  • AGX3 compiler: agx3_copy_encode_reg_to_uniform() still declares the composer tables of an instruction it now writes byte by byte. enable_all_threads_agx3b/agx3c are never referenced.
  • Compiler unit tests: four tests put a bare EXPECT_*() under an if. The gtest macros expand to an if/else, so GCC reports a dangling else.
  • src/asahi/lib: an unreferenced precompiled copy of the grid-setup helper, plus two unused locals.
  • Honeykrisp: nine unused locals left over from earlier revisions. The G17P vertex program info call keeps running; only its unused result goes. On failure it clears the info, and the draw paths then refuse the variant on their own.

There is one commit per component (agx:, asahi:, hk:). None of them changes behaviour.

Testing

Rebased on agx3b 5544dbf; the same errors are still there. On Fedora 45 aarch64, configured with -Dbuildtype=debugoptimized -Dwerror=true -Db_ndebug=false -Dgallium-drivers=asahi,zink -Dvulkan-drivers=asahi -Dbuild-tests=true -Dtools=asahi:

  • GCC 16.2: builds with 0 warnings. meson test gives 55/56; the one failure is nir_tests, which is fixed separately by the nir/range_analysis PR (with both: 56/56).
  • Clang 23.1: all AGX code builds. The only remaining errors are two pre-existing upstream ones, outside AGX, that are new in Clang 23: src/egl/main/eglglvnd.c (-Wunused-but-set-global) and src/glx/glxcmds.c (-Wattribute-alias).

🤖 Generated with Claude Code

Building with -Dwerror=true (as Mesa CI does) fails with both GCC and
Clang:

 - agx3_copy_encode_reg_to_uniform() kept the composer field tables of
   the instruction it now writes byte by byte, so both arrays are unused.
   Keep the field values in the comment instead.
 - enable_all_threads_agx3b/agx3c in agx3_pack.c are never referenced.
 - Four unit tests put a bare EXPECT_*() under an if; the gtest macros
   expand to an if/else, which GCC reports as a dangling else. Add
   braces.

No functional change.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
GCC and Clang reject these with -Dwerror=true:

 - agx3_g17p_grid_helper_core.c carries a precompiled copy of the grid
   setup helper that nothing references; the helper is built from its
   source text, which is all agx3_g17p_grid_helper_source() returns.
 - copies_start in the IOTO load core and chan in the prolog/epilog
   varying bound check are computed and never read.

No functional change.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
With -Dwerror=true Honeykrisp does not build: several functions keep
locals from earlier revisions that are no longer read (the render
command's stream length and start, the dispatch sink start, the heap
pointer pair now read from rodata, the scaled-conversion offset replaced
by the aligned 32-bit load, and two unused handles).

The G17P vertex program info call stays, without its unused result: on
failure it clears the program info, and the draw paths then refuse the
vertex program variant on their own.

No functional change.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide merged commit 458e8ab into agx3b Oct 11, 2026
@RyanTheTide
RyanTheTide deleted the aurora/agx-werror branch October 17, 2026 09:35
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.

1 participant