Skip to content

drm/asahi: g17: take a context's render pool identity when it is created - #1981

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
djdev/g17-render-id-at-create
Nov 16, 2026
Merged

DjDeveloperr merged 1 commit into
integration/aurorafrom
djdev/g17-render-id-at-create

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Every queue that renders has a render pool, and every render pool has one of 127 identities. The driver takes the identity when it builds the pool, at the queue's first render. A render graph that the firmware may still link from a queue's work list stays allocated until the firmware stops, and keeps its pool's identity until then. Once such graphs hold the identities that live queues need, a queue's first render is refused: it waits up to 30 seconds for render capacity, fails, and the client sees a lost device in a later submission.

Change

  • On the A18 Pro, a context takes its render pool identity when it is created. Open queues hold at most 58 identities, so graphs kept until the firmware stops can hold up to 69 before a new queue is refused. Past that, creating a queue fails with EBUSY after waiting up to two seconds, so the application gets an error from the call that creates the queue. Running clients are not affected.
  • A render pool that cannot be placed yet keeps its identity for the next attempt. A creator that waits for a closing queue holds no identity, and a closed context gives back an identity it never used when it is reclaimed.
  • Unchanged: the M4 Pro and Max take the identity at the first render, before the pool's memory is placed, as before; they have not been tested with this change. M5 GPUs use their own identities.

Limit

Kept render graphs still hold their identities and pools until the firmware stops. This change moves the refusal to queue creation; it does not free them. On the A18 Pro every queue now holds an identity, including queues that never render.

Testing

  • Builds for arm64 with the MacBook Neo kernel configuration; no new warnings in the changed files.
  • MacBook Neo (A18 Pro), one boot of a test build: this change and drm/asahi: g17: show each process's share of the queues #1982 on the 7.3.0-40 release, whose
    driver code is this PR's base, plus test-only switches (not part of this PR) that count a fixed number
    of render pool identities as held and restore taking the identity at the first render.
  • Every queue holds an identity: the idle desktop holds 15 for 15 queues (7 without this change), and
    identities equalled open queues in every snapshot, up to 57 for 57 under three dEQP-EGL processes.
  • 100 identities counted as held (27 left), dEQP-EGL multicontext.non_shared_clear:
    • identity at creation: the 13th context's creation failed after about 2 s (2.2 s for the whole
      case); no lost device, no GPU errors in the kernel log, the desktop unaffected. The case itself
      fails because it needs 32 contexts;
    • identity at the first render (the previous timing): that context's first render waited 26 s and
      the process lost its device.
  • Without the switches, the same boot's soak (three- and four-client Vulkan stress, 150 s each;
    dEQP-EGL multi-context cases in one and in two and three processes at once; a two-client run) gave the
    same results as the unchanged driver: no lost devices, and only the queue and address-space
    refusal messages that the unchanged driver also logs when those steps overfill the queues.
  • Not covered: render graphs actually kept until the firmware stops (three provoked GPU recoveries
    left none; the identities of their clients came back), a creator waiting for a closing queue, and
    the M4 Pro and Max.
  • MacBook Neo, the fast CTS gate (a sample of every Vulkan CTS group plus EGL, GLES 3.0 and 3.1) on one kit of this change with drm/asahi: g17: log capacity refusals at info level, not as warnings #1977, drm/asahi: g17: fit a render pool for every queue on the A18 Pro #1979 and drm/asahi: g17: show each process's share of the queues #1982 on the 7.3.0-40 release: 0 regressions and no GPU errors in the kernel log.

🤖 Generated with Claude Code

A render pool identity is one of 127, taken when a queue's render pool
is built at its first render. A render graph that the firmware may
still link from a queue's work list stays allocated until the firmware
stops, and keeps its identity until then. Once such graphs hold the
identities that live queues need, a queue's first render is refused:
it waits for render capacity, fails, and the client sees a lost device.

On the A18 Pro, take the identity when the context is created. Open
queues hold at most 58 identities, so graphs kept until the firmware
stops can hold up to 69 before a new queue is refused. Past that,
creating a queue fails with EBUSY after waiting up to two seconds, so
the application gets an error from the call that creates the queue,
while running clients are not affected. A refused render pool placement
keeps the identity for the next attempt; a creator that waits for a
closing queue holds none, and a closed context gives its identity back
when it is reclaimed.

The M4 Pro and Max keep taking the identity at the first render, before
the pool's backing is placed, as before; M5 GPUs use their own
identities.

Signed-off-by: Diljit Singh <[email protected]>
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