Repository navigation
borealis: enable HAL200 lossless compression on G16G - #1050
5 commits merged into
Conversation
Select private colour and depth compression, shared compressed modifiers and compressed mip blits by the native HAL200 hardware capability. G16G uses the classic submission crossover and G17P keeps the dual-submission crossover. Use effective stencil usage for split depth/stencil layouts. Check shared modifier queries with the allocation policy, reject unusable modifier lists and validate compressed import strides. Probe supported image dimensions for host copy layout compatibility. Exercise capability selection, compressed layouts and image creation with separate stencil usage, modifier lists and explicit DMA-BUF layouts. Use a sampled-image layout for samplerless graphics resolves. The compressed source takes this path, and its push writes must match the pipeline layout even when blits use combined image samplers. Split a 2D-array VkCmdResolveImage into per-layer passes on native HAL200 whenever either image is compressed. The qualified BG/EOT contract is single-layer, and image copies and blits already split their 2D-array regions this way (hk_g17p_image_copy_slice, hk_g17p_image_blit_slice); the generic vk_meta resolve otherwise reaches the compressed array through a layered render pass whose per-layer metadata stride is derived by the hardware and is unreliable under concurrent GPU use. Gate 1-8B 2x/4x MSAA colour compression on a separate AGX_CAP_HAL200_MSAA_COLOR_COMPRESSION capability, enabled only on G17P. The Gen9 PBE/texture/ZLS/AIL encodings are identical across G16G and G17P, and 1x colour (2D, arrays, cube, 3D), 16-byte single-sample 2D colour, and 1x/2x/4x depth (single-layer and arrays, both stencil planes) all pass the --jobs 4 full CTS on G16G at 0 failures. The 1-8B 2x/4x MSAA colour variants still hit intermittent PBE unmapped reads on a handful of diff_layout_copy_before_resolving cases on G16G (the qualified path on G17P), so the separate capability keeps those shapes plain on G16G while the HAL200 contract for every other shape ships. Follow-up on the MSAA colour side keyed on the same cap. Signed-off-by: Diljit Singh <hey@djdev.me>
Exact-Head Hardware Verification — MacBook Neo (
|
| Workload | Base (e87a3156) |
Head (1b94686b) |
Delta | Notes |
|---|---|---|---|---|
compress.bw msaa4 1080p |
294.99 us |
294.77 us |
-0.07% |
G17P 4x MSAA color compression intact |
render.heavy geom 1080p |
1,036.27 us |
1,033.59 us |
-0.26% |
|
copy.bw buf2img |
22.90 GB/s |
22.98 GB/s |
-0.37% |
12/12 64 MiB CRCs 8e2eb8fc |
copy.bw buf2buf |
23.99 GB/s |
24.08 GB/s |
-0.35% |
|
copy.bw img2img |
23.66 GB/s |
23.49 GB/s |
+0.71% |
|
render.heavy fill 1080p (BAAB) |
814.34 us |
805.32 us |
-1.11% |
Order-reversed check (warm) |
render.heavy fill 2160p (BAAB) |
3,012.05 us |
2,994.12 us |
-0.60% |
Order-reversed check (warm) |
render.postfx 4 1080p (BAAB) |
800.00 us |
799.38 us |
-0.08% |
Order-reversed check (warm) |
- All
5/5compute CRCs matched on both arms (gaussian,bilateral,sobel,harris,stereo).
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 1b94686bb1021c953696ddd17af93dbe5472d310.
Blockers: 1. src/asahi/vulkan/hk_image.c:982 now rejects the external format query for a supported compressed RGBA8 dma-buf with color-attachment and attachment-feedback-loop usage. The explicit import at line 1586 still accepts it. Preserve import eligibility in the format query and keep the allocation policy in modifier-list selection.
Checked: The HAL200 capability now governs the shared compression path. The separate MSAA color bit has a measured fault on G16G. Checked matching resolve layouts and descriptor writes, per-layer address selection, split stencil usage and compressed plane pitch. J773g and J700 have exact passing rows.
Evidence
For an otherwise eligible RGBA8 2D dma-buf, the former query used hk_g17p_shared_compression_supported(), which allows feedback-loop usage for imports. The new query passes that same usage to hk_can_compress_create_info(). Its color path necessarily returns false at hk_image.c:462–474 when that bit is set. Explicit creation still uses the sharing helper at line 1588. Zink forwards the image's usage to the external format query in zink_resource.c:1348–1385.
Please cover both sides in the compression contract test: the dma-buf query and explicit import should accept a compatible RGBA8 modifier with feedback-loop usage, while modifier-list allocation should keep declining compression for that usage. The layout and packed-format checks can stay common.
J773g ran the 5,981-case selection twice with 3,050 passes and 2,931 unsupported in each run. The J700 row reports 364 targeted passes and zero failures or GPU faults. These exercise the transfer paths but do not cover this external modifier query.
Use the shared modifier predicate when reporting image format support. A compatible compressed dma-buf can be imported with attachment feedback even though modifier-list allocation declines compression for that usage. Exercise the query, explicit plane layout and modifier list with the same RGBA8 dma-buf usage on G16G and G17P. Signed-off-by: Diljit Singh <hey@djdev.me>
Keep bit 15 for sparse binding and give the two HAL200 compression capabilities distinct bits. Exercise all three capability predicates in the chip table test. Signed-off-by: Diljit Singh <hey@djdev.me>
|
Updated
Exact-head verification at
Ready for |
Keep bit 16 for full ZLS render bounds and move the Borealis HAL200 compression capabilities to bits 17 and 18. Signed-off-by: Diljit Singh <hey@djdev.me>
|
Merged #1040 into this branch at Fedora passed all 316 Asahi tests on this commit with |
Exact-Head Hardware Verification Refresh — MacBook Neo (
|
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 94284cc11874d4bdbaa5ed3fa857f011c47728b4.
Blockers: src/asahi/lib/agx_chip_caps.h also gives bit 17 to the native mixed epilog in #1059. Once #1059 lands, forward this change with distinct HAL200 lossless and MSAA bits, such as 18 and 19 if still free. Run the capability and compression-contract tests and refresh the J773g and J700 rows at the resulting head.
Checked: The compressed dma-buf feedback-loop query now agrees with explicit import. Both use the shared modifier predicate. The predicate admits the HAL200 lossless capability or the AGX3C/HAL300 hardware format, then checks the image shape and store class. Modifier-list allocation still declines feedback-loop compression.
Evidence
The test now covers query and explicit import acceptance plus allocation refusal with feedback-loop usage. The exact J700 row reports 316/316 host tests, 364 CTS passes, zero CTS failures and zero GPU faults. The J773g row tests an earlier head.
Keep bit 17 for the native mixed-format epilog and move the Borealis HAL200 compression capabilities to bits 18 and 19. Signed-off-by: Diljit Singh <hey@djdev.me>
|
Verified Fedora passed all 318 Asahi tests with |
|
PASS on MacBook Neo J700 (
|
RyanTheTide
left a comment
There was a problem hiding this comment.
Resolved: HAL200 lossless compression and MSAA colour compression are capability bits (AGX_CAP_HAL200_LOSSLESS_COMPRESSION, AGX_CAP_HAL200_MSAA_COLOR_COMPRESSION) in the chip caps table, and the format-properties path tests the capability. The contract test pins which chips carry them and that MSAA compression implies lossless. Bits moved to 18/19 after #1059. 318/318 asahi, exact-head J773g + J700 PASS, mirror CI green. Clearing my change request.
b502b36
…l200-compress borealis: enable HAL200 lossless compression on G16G
|
Post-merge regression on G16G with an older kernel. M4 Air (J713, Apple M4 G16G, Two asks: (1) Which kernel change does this need, and is it in the current EDGE/fleet89 kernel? (2) Per the no-gates rule, Mesa should read that capability from the kernel UAPI and fall back to uncompressed depth/stencil when it's missing. Right now every G16G Mac on an older kernel loses depth/stencil rendering. If the capability can't be probed, we should revert the depth/stencil half until it can. Evidencetraces/gpu/20261127-merge-blitz-rows/1171-j713/ (bisect-g16g-ds-einval.log, kmsg.txt, np-aurora-wip-90211df, np-system-mesa). Found during the J713 row for #1171, which isn't the cause. |
What: Enable HAL200 lossless colour and depth/stencil compression on G16G (M4), matching the G17P (M4 Pro / M4 Max / A18 Pro) policy for every shape whose metadata encoding is identical across the two parts. 1-8B 2x/4x MSAA colour on G16G is held behind a separate capability pending triage of intermittent PBE reads in the full
--jobs 4CTS resolve_image stress.Tested: J773g (Apple M4, G16G B0) at
1b94686bb102, Linux7.3.0-ARCH-m4mainefed1ae3:--jobs 42x back-to-back on the candidate: 3050 Pass / 2931 NotSupported / 0 Fail each run, 0 DeviceLost, kernel healthfailed 0 errno 0 degraded 0throughout.e87a3156f31fand B1b94686bb102: all roundsrc=0, 60/60 rows ok and 0/44 CRC-invalid in each round. Within-arm stabilityB2/B1 = 1.0005x,A2/A1 = 0.9969x. Cross-armB/A = 1.63x(compress 2.72x, transfer 1.65x, render 1.30x).aurora-wipbaseline at 0.9551x (105/202 wins); candidate/baseline same-rows ratio 1.183x, withcompress.bwat 2.72x,transfer1.69x andrender1.13x.-Db_ndebug=false -Dtools=drm-shim(asahi+poly suites, 320 tests includingrun-shim.py): 317 Ok / 3 Fail, same 3 pre-existingasahi-egl-priority-{allow,deny,once}failures asaurora-wiptip.DEFAULT_BRANCH=aurora-wip .github/aurora/agent-policy.sh pr HEAD) →PR is clean.Risk: two-way · G16G (M4) and G17P (M4 Pro, M4 Max, A18 Pro). Code paths touched are read by every HAL200 AGX3B part; G18G, M5 and G15*/AGX2 stay on their existing paths through narrow capability bits.
Not yet: 1-8B 2x/4x MSAA colour compression on G16G is gated separately by
AGX_CAP_HAL200_MSAA_COLOR_COMPRESSION(G17P only) because the full--jobs 4CTS still witnesses intermittent PBEread unmapped level 3 unit 0x41on a handful ofdEQP-VK.api.copy_and_blit.core.resolve_image.diff_layout_copy_before_resolving.{2_bit_general_transfer_dst_optimal_bind_offset, 4_bit_general_transfer_dst_optimal}variants on G16G. The Gen9 PBE / texture / ZLS / AIL metadata encodings are byte-identical across G16G and G17P, so turning MSAA colour on for G16G later is a one-row change to the capability table once the triage lands in a dedicated follow-up.Details
The policy already shared between G16G and G17P (
hk_hal200_compression_eligible) is now selected byAGX_CAP_HAL200_LOSSLESS_COMPRESSIONinstead of a chip-id list, so every path that depends on it — private colour and depth compression, sharedDRM_FORMAT_MOD_APPLE_GPU_TILED_COMPRESSEDmodifiers, Gen9 compressed compute mip blits (hk_g17p_compressed_blit_supported), in-placelibagx_agx3_decompressspill, and thehk_chip_shared_compression_supportedmodifier advertisement — enables on G16G without touching call sites.Supporting fixes:
hk_image.c: use effective stencil usage for split depth/stencil layouts; check shared modifier queries with the allocation policy, reject unusable modifier lists, validate compressed import strides; extend the host-copy performance probe's cube-compatible array layer count to include native HAL200 and M5 so the HIC query reflects the real shape.hk_cmd_meta.c: use a sampled-image layout for samplerless graphics resolves (the compressed source takes this path, and its push writes must match the pipeline layout even when blits use combined image samplers); split 2D-arrayVkCmdResolveImageinto per-layer passes on native HAL200 whenever either image is compressed, mirroringhk_g17p_image_copy_slice/hk_g17p_image_blit_slice— the BG/EOT contract is single-layer and the genericvk_metaresolve otherwise reaches compressed arrays through a layered render pass whose per-layer metadata stride is derived by the hardware and is unreliable under--jobs 4concurrency.pbe_header()helper (matching the-Winitializer-overridesdiscipline upstream switched to for the texture packets).AGX_CAP_HAL200_MSAA_COLOR_COMPRESSIONbit (G17P only for now) keeps 1-8B 2x/4x MSAA colour on G16G plain while the depth MSAA, 1x colour, 16-byte colour, and shared compressed modifiers all reach the shared Gen9 encoding on G16G.Evidence
Base
A=e87a3156f31fe5ec8277c7e8b83aa690c5329ae4(origin/aurora-wip at rebase time, rebased again cleanly onto newer tip pre-push); candidateB=1b94686bb1021c953696ddd17af93dbe5472d310. Both AArch64 tarballs built viafedora-mbuild.shwithm5-super16-gl-vk-zink.opts(ownerm4-hal200-g16g-A).CTS pass 1 (B,
1b94686bb102) —cts-B-1/summary.json:CTS pass 2 (B, back-to-back) —
cts-B-2/summary.json:Fedora
-Db_ndebug=false -Dtools=drm-shimCI at1b94686bb102:FEDORA-CI 1b94686bb1021c953696ddd17af93dbe5472d310 312/3 after-rc=1, failures ={asahi-egl-priority-allow, asahi-egl-priority-deny, asahi-egl-priority-once}(identical toaurora-wiptipe87a3156f31fre-run).