Repository navigation
drm/asahi: g16: accept 48 KiB tile buffers on the M4 - #3339
Merged
Merged
Conversation
macOS 26B123 runs MSAA4 render passes on the M4 (G16G) with 48 KiB tiles: 32x16 utiles of up to 24 bytes per sample. The g16 backend refused any tile buffer over 32 KiB, so Mesa has to fall back to 16x16 utiles for the same passes, which doubles the tile count of a 1080p MSAA4 pass. Keep the limit per chip in the g16 configuration: 48 KiB for T8132, 32 KiB for the M3 family (T6030, T8122) until each is shown to work there. Report the higher limit as DRM_ASAHI_FEATURE_TILE_BUFFER_48K, bit 46, so that userspace sizes tiles from what the kernel accepts. The g15, g17 and g18 backends do not report the bit. The 48 KiB value is the one macOS programs on this GPU; the hardware may accept more, but this backend does not claim it. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Contributor
Author
|
Non-author review at Checked
Before merge
|
The M5 path of g17 admits 64 KiB tile buffers without reporting DRM_ASAHI_FEATURE_TILE_BUFFER_48K, so "instead of 32 KiB" in the bit's comment is wrong there. Say that the bit is about the GPU that reports it, and that 32 KiB is the portable limit without it. Comment only. Signed-off-by: DjDeveloperr <hey@djdev.me>
Contributor
Author
|
Re-review at
|
Contributor
Author
|
J516s (MacBook Pro 16" M3 Pro, G15S) row at
|
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.
What: on the M4 (G16G), let render commands use tile buffers of up to 48 KiB, as macOS does, and tell userspace with a new feature bit. Pairs with aurora-silicon/mesa#1194, which uses 48 KiB tiles only when the kernel reports the bit.
max_tile_buffer): 48 KiB for T8132 (M4, G16G), 32 KiB as before for T6030 (M3 Pro, G15S) and T8122 (M3, G15G).DRM_ASAHI_FEATURE_TILE_BUFFER_48K, bit 46 (a#defineafter the enum, like bits 32–45). The g16 backend reports it only when the chip's limit is 48 KiB. The g15, g17 and g18 backends don't report it.0x6002and tilebuffer_control0x40018, which is 32×16 utiles at 4 samples and 24 × 2 KiB = 48 KiB per tile. 48 KiB is the value macOS uses. This PR does not claim it is the hardware maximum.Tested: J773g (M4 Mac mini) at
2fc7c2147b28with the paired Mesa change: the MSAA4 deferred rows are 4.8–5.3 % faster on the GPU, the Vulkan CTS run below has 0 failures, and there were 0 GPU faults. The second commit (f393918abe5b) only rewords the bit's comment in the UAPI header, with no code change, so these results stand for the head.7.3.0-ARCH-m4kgtb48-2fc7c214(maind3552efa+ the first commit), built natively on the J773g. Mesa base aurora-wip8ac326fvs the Mesa PR7a5a930, both on this kernel, in one boot, in the order base, PR, PR, base. gpubench-vk 13.test-command-stream.pyhas a new admission test: a 32 KiB tile is accepted under both limits; a 48 KiB tile (24 B × 32×16 × 4 samples) is refused at 32 KiB and accepted at 48 KiB; a 56 KiB tile is refused under both.Risk: two-way door (a plain revert undoes it) · Macs on the g16 backend (M4 G16G gets 48 KiB; M3 G15S/G15G stay at 32 KiB)
Not yet: