Repository navigation
asahi/lib: drop uncalled functions and two unused source files (-582 lines) - #508
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
src/asahi/lib carries functions and whole files that nothing calls. Most were added beside a variant that callers actually use: a
_trustedform, a_mipform, 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 usesagx_g18g_word_mrt_mask.agx_pbe_g18_layered_pack. Callers use the_mip_packform; its header comment is merged into that form's.agx_ppp_w_clamp_cull2_core_supportedagx_ioto_profile_control_unpackandagx_ioto_state_tail_pack_shaderagx_vdm_mesh_threadgroup_unpackagx_ioto_g17p_external_setup_launcher_compose(the non-trusted form). Its only user calls the_trustedform, and a validator comment now points there.drm_shim_driver_prefers_first_render_nodeinasahi_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, theagx3_g17p_grid_helper_source()declaration,AGX3_G17P_GRID_HELPER_SHADER_SIZEand 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
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.Evidence
-ffunction-sections -Wl,--gc-sectionskeeps none of the removed non-static functions in any linked binary.git grep -w(including.py, meson and tests): after the change, the only remaining hit is the upstream 26.2.0 relnote line.agx_ioto_*_core.candagx_ppp_w_clamp_cull2_core.c, in other hunks.asahi_noop.cnear lines 240 and 560-580; this change is at line 25.src/asahi/lib/meson.build; this change is inlibasahi_lib_files.agx_chip_*_reference()test-only switch copies ofAGX_CHIP_TABLE. asahi: admit the M5 Ultra (G17D) as one row of the chip table, so Vulkan runs on the Mac Studio's GPU instead of failing at device open #362 and loader: pick zink for the M5 Ultra's GPU, so Hyprland and EGL clients start on its GPU instead of aborting #363 add rows to them, so they are left for a follow-up once those land.DRM_ASAHI_GPU_HAL_LEGACYand the legacy driver-name branch. G15S and T8122 still select them.Still to run
Nothing.
Assisted-by: LLM (Claude:Opus 5.5)