Skip to content

feat(agc): DMA_DATA prefetches to DST_SEL nowhere - #1709

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
MathiasDevelopes:feat/agc-dma-data-prefetch
Oct 10, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
MathiasDevelopes:feat/agc-dma-data-prefetch

Conversation

@MathiasDevelopes

Copy link
Copy Markdown
Contributor

What

DMA_DATA with DST_SEL 2 (V_411_NOWHERE in Mesa's src/amd/common/sid.h) reads its source into L2 and stores nothing. libSceAgc emits it as an L2 prefetch, with the source address repeated as the destination (c0055000 60200000 8038e000 1d 8038e000 1d 8000caf0). The validator rejected it with "DMA_DATA register or prefetch destination is not implemented", so a title that prefetches aborts.

A prefetch of a memory source (SRC_SEL 0 or 3) is now accepted and writes nothing:

  • ResolveStore returns it as an empty store, so the packet stays ordered without a drain.
  • DecodeMemoryCopy still rejects it, so no buffer copy is recorded.
  • Execute returns before reading the source.

A prefetch of a register, GDS or immediate source still throws ("DMA_DATA prefetch of a register, GDS or immediate source is not implemented"), and so does a register destination (DAS).

Source of the semantics: Mesa src/amd/common/sid.h (S_411_DST_SEL, V_411_NOWHERE). Not measured on hardware: a prefetch has no visible memory effect to measure.

Tested

Windows 11, RTX 3060. agc_driver_pm4 covers the new path: a prefetch resolves as an empty store, does not decode as a copy, leaves memory unchanged, and the immediate-source and register-destination forms throw. All 183 agc_driver tests pass, and tools/check_conventions.py --base origin/main passes. PPSA07906 (Unreal Engine 5) issues these packets at startup and aborted on them; with the change it gets past them and renders its intros.

Checklist

DMA_DATA with DST_SEL 2 (V_411_NOWHERE in Mesa's src/amd/common/sid.h)
reads its source into L2 and stores nothing; libSceAgc emits it as an
L2 prefetch with the source address repeated as the destination. It
threw as a register or prefetch destination. A prefetch of a memory
source is now accepted and writes nothing: ResolveStore returns it as an
empty store, so the packet stays ordered without a drain,
DecodeMemoryCopy keeps rejecting it and Execute skips it. A prefetch of
a register, GDS or immediate source and a register destination still
throw.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 8, 2026 17:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the agc libSceAgc* label Oct 8, 2026
@fisherjoey

Copy link
Copy Markdown
Contributor

Linux results, since this was tested on Windows only. Everything passes here.

Nobara 44 (Linux 7.2), GCC 16.2.1, Release, BUILD_TESTING=ON. This PR merged onto main f145139 cleanly.

main f145139 main + this PR
RTX 5070 Ti, driver 595.91.07, ctest -R agc_driver -j1 207 / 207 207 / 207
RADV, Ryzen 5 7600X iGPU (gfx1036), Mesa 26.2.1, same 207 / 207 207 / 207
CPU tests (-E agc_driver) 286 / 287 286 / 287

The CPU failure is guest_dynamic_loader, which fails the same way on main.

@XairRrR

XairRrR commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Uncharted: Legacy of Thieves Collection (PPSA05684) stops at this on main:

AGC driver: DMA_DATA at DWORD 55: DMA_DATA register or prefetch destination is not implemented

I fixed it independently the same way (DST_SEL 2 from a memory source writes nothing and is not ordered as a store) while bringing the title up to its main menu, so I'm not opening a competing PR. I have not run this branch itself with the title.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#2156 core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp L573

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants