Skip to content

drm/asahi: m3: drop the two unreachable T6030-only branches - #2478

Merged
DjDeveloperr merged 2 commits into
integration/aurorafrom
sweep/redundant-gates-m3
Nov 20, 2026
Merged

DjDeveloperr merged 2 commits into
integration/aurorafrom
sweep/redundant-gates-m3

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

drivers/gpu/drm/asahi/m3/m3_runtime.rs had two inline chip_id == 0x6030 tests: publish_mixed() refused any SoC but 0x6030, and boot logged the Globals debug word only on 0x6030 (84ef8e4). The M3 runtime has a table for T8122 only (m3_soc::SOCS), so soc().chip_id is never 0x6030 there. Both branches were dead code: publish_mixed() always returned EINVAL through that test, and the debug word was never read.

Change

Delete both branches.

  • publish_mixed() drops the chip test. It is reached only for a batch that holds both render and compute commands, and next_batch() builds such a batch only when policy::mixed_prefix() allows it, so the result is the same on every SoC.
  • The boot-time Globals debug-word log is removed, and with it M3Config::log_globals_debug(), which had no other caller.
  • The comments the first commit added go with the code.

No functional change on any SoC the runtime starts on.

Testing

Still to run

None: the deleted code could not run on any supported SoC.

Assisted-by: LLM (Claude:Opus 5.5)

…0-only

publish_mixed() refuses unless the chip is 0x6030, and boot logs the
Globals debug word only on 0x6030. These are not GPU generation gates:
the two-engine prefix was measured on the T6030 firmware's idle queues,
and the debug word sits in the T6030 firmware's Globals layout. The M3
runtime starts only on T8122 (m3_soc::SOCS), whose Legacy and Extended
firmware were not shown to take either, so keying them on G15 would turn
them on there without evidence.

Keep the gates and say so in the code. Comment only.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 20, 2026 00:25
publish_mixed() refused any SoC but 0x6030, and boot logged the Globals
debug word only on 0x6030. The M3 runtime has a table only for T8122
(m3_soc::SOCS), so soc().chip_id is never 0x6030 here: publish_mixed()
always returned EINVAL through that test and the debug word was never
read. Both branches are dead code.

Delete them. publish_mixed() is only reached for a batch that holds both
render and compute commands, and next_batch() builds such a batch only
when policy::mixed_prefix() allows it, so dropping the chip test there
changes nothing. With the boot-time log gone, log_globals_debug() has no
caller and goes too. The previous commit's comments go with the code.

No functional change on any SoC the runtime starts on.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide RyanTheTide changed the title drm/asahi: m3: document why two paths stay T6030-only drm/asahi: m3: drop the two unreachable T6030-only branches Nov 20, 2026

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed at 7e75526.

Both branches were dead code. m3_soc::SOCS has only T8122 (m3_soc.rs:262), and policy::mixed_prefix() already returns 0 for any chip but 0x6030 (m3_batch_policy.rs:17). So next_batch() never builds a two-engine batch, and dropping the chip test in publish_mixed() changes nothing. After removing log_globals_debug(), globals_debug_off() and m3_globals_debug::OFFSET still have users (m3_adt_config.rs:1031, g15_raw.rs:1607), so no dead-code warnings appear. Built in your swfx1 kernel and host-tests passed on this head. This also answers the earlier "why do these stay T6030" commit: they are now gone, not justified.

The T6030 tests in stage_timestamps(), mixed_prefix() and coalesce_render_stamps() remain. They are reachable on nothing, so they are candidates for the same sweep.

@DjDeveloperr
DjDeveloperr merged commit cb5d4b9 into integration/aurora Nov 20, 2026
1 check passed
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