Skip to content

asahi/lib: drop uncalled functions and two unused source files (-582 lines) - #508

Merged
RyanTheTide merged 2 commits into
aurora-wipfrom
deadweight/agx-lib-dead
Nov 19, 2026
Merged

RyanTheTide merged 2 commits into
aurora-wipfrom
deadweight/agx-lib-dead

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown

Problem

src/asahi/lib carries functions and whole files that nothing calls. Most were added beside a variant that callers actually use: a _trusted form, a _mip form, or a word-based mask. One file pair has never been included by anything.

Change

Remove these functions (definitions and prototypes):

  • agx_g18g_rgba8_mrt_mask. G18G uses agx_g18g_word_mrt_mask.
  • agx_pbe_g18_layered_pack. Callers use the _mip_pack form; its header comment is merged into that form's.
  • agx_ppp_w_clamp_cull2_core_supported
  • agx_ioto_profile_control_unpack and agx_ioto_state_tail_pack_shader
  • agx_vdm_mesh_threadgroup_unpack
  • agx_ioto_g17p_external_setup_launcher_compose (the non-trusted form). Its only user calls the _trusted form, and a validator comment now points there.
  • drm_shim_driver_prefers_first_render_node in asahi_noop.c. The drm-shim core never reads it. Upstream removed it (26.2.0 relnotes), and it came back with a file copy in 5544dbf.

Remove these files:

  • agx_texture_side_entry.{c,h}. Nothing includes the header, and its pack/decode functions have no caller.
  • agx3_g17p_grid_helper_core.c, the agx3_g17p_grid_helper_source() declaration, AGX3_G17P_GRID_HELPER_SHADER_SIZE and the comment describing that binary. The only function had no caller, and the binary it described was already removed in 2033761. The geometry and LDSHDR macros in that header stay, since hk and Gallium use them.

Net: +14 / -596 lines (-582), 2 commits.

Testing

  • x86 build (clang, release with asserts) of the asahi Gallium and Vulkan drivers with tools=asahi,drm-shim and build-tests=true, then meson test --suite asahi (all 193 tests, including the drm-shim Gallium tests): 192 OK / 1 FAIL, the same as base. The one failure, hk_dual_source_gpl, also fails at base in this container.
  • Each commit was built on its own; same result.
  • Nothing removed had a caller, so no hardware rows are needed.
Evidence

Still to run

Nothing.

Assisted-by: LLM (Claude:Opus 5.5)

None of these has a caller anywhere in the tree (git grep over all of
src/, tests and meson included), and none shows up in any linked binary
of a --gc-sections build:

- agx_g18g_rgba8_mrt_mask, agx_pbe_g18_layered_pack and
  agx_ppp_w_clamp_cull2_core_supported: added by 44236b2 (Acelogic)
  without a caller; G18G uses agx_g18g_word_mrt_mask and
  agx_pbe_g18_layered_mip_pack.
- agx_ioto_profile_control_unpack and agx_ioto_state_tail_pack_shader:
  added by 7416b6a (DjDeveloperr), never called.
- agx_vdm_mesh_threadgroup_unpack: added by a6e1f7d (DjDeveloperr),
  never called.
- agx_ioto_g17p_external_setup_launcher_compose: added by 7416b6a;
  the only user (agx3_graphics_program.c) calls the _trusted form that
  44236b2 added.
- drm_shim_driver_prefers_first_render_node in asahi_noop.c: brought in
  by 5544dbf from another tree; the drm-shim core here never reads
  it (upstream removed it, see the 26.2.0 release notes).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Both were added by 7416b6a (DjDeveloperr) and never gained a user:

- agx_texture_side_entry.c/.h: no file includes the header and nothing
  calls agx_texture_side_entry_pack/_decode (git grep over src/, tests
  and meson); neither symbol is in any linked binary of a --gc-sections
  build.
- agx3_g17p_grid_helper_core.c only held agx3_g17p_grid_helper_source(),
  the MSL text of the helper. It has no caller; the image it described
  went away in 2033761. The header keeps the geometry contract and
  LDSHDR kinds that hk and the gallium driver use; drop the comment and
  size macro that described the removed image.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide merged commit f8a79d6 into aurora-wip Nov 19, 2026
@RyanTheTide
RyanTheTide deleted the deadweight/agx-lib-dead branch November 19, 2026 16:18
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