Repository navigation
borealis: compress private 1x 2D colour images on G15G - #1352
Conversation
G15G (M3) had no lossless compression in Borealis. Add AGX_CAP_HAL200_COLOR_2D_COMPRESSION, the private single-sample colour subset of the HAL200/Gen9 policy, and give it to G15G alone. With it, hk_hal200_compression_eligible() admits plane 0 of an optimal 1x 2D image with one level and one layer in a 1-8B colour format, without cube compatibility; the common usage, flag, store-class, import/WSI and sparse checks still apply. Depth and stencil (whose ZLS data carries its own compression metadata), MSAA, layered, 3D, mip chains, 16-byte formats, shared modifiers and compressed storage stay off. The compressed compute blit, its pair-store shortcut and the direct compressed block-mip store keep their HAL200 gates, so G15G copies go through the existing compressed-image graphics fallback. Measured on J615 with the macOS 27.2 firmware: every image the driver compresses is 1x 2D colour, and the upload, clear, draw, sample, copy/blit, host-image-copy and import groups pass unchanged. Host image copy now reports identicalMemoryLayout false for those formats, as on the chips that already compress. G15S and G15C are unmeasured and stay off. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
There was a problem hiding this comment.
Verdict: MERGE at 7ae7f27e
Blockers: None.
Checked:
AGX_CAP_HAL200_COLOR_2D_COMPRESSION = 1u << 31(src/asahi/lib/agx_chip_caps.h) occupies the remaining unique bit in the 32-bitunsignedcapability mask (all_capsupdated intest-chip-caps.c) and is enabled onG15Galone, keepingG15SandG15Coff.hk_hal200_compression_eligible()(src/asahi/vulkan/hk_g17p_compression.h) computescolor_2d_only = !lossless && agx_chip_has_cap(chip, AGX_CAP_HAL200_COLOR_2D_COMPRESSION), leavingG16G/G17P(lossless == true) unchanged while restrictingG15Gto plane 0 of optimal 1x single-level single-layer 2D 1–8B colour images withoutVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, followed by all common pNext (external/WSI), flag, usage, minimum-extent,hk_mip_level_through_pbe(),hk_g17p_store_class_matches(), andhk_can_compress()guards.- Audited HAL200-only paths (
hk_cmd_meta.c:2257,:2965,hk_g17p_meta_copy_core.h:277,hk_image.c:610,:1267,hk_chip_shared_compression_supported()): all remain gated onAGX_CAP_HAL200_LOSSLESS_COMPRESSION, so G15G takes the existing compressed graphics fallback and leaves depth/stencil, MSAA, layered, 3D, mip chains, 16-byte formats, shared modifiers, and compressed storage plain. - Unit test updates (
test-chip-caps.c,test-hk-compression-contract.c,test-hk-g16s-compression.cwhere allcheck_shape()formats are 1–8B colour, andtest-hk-g17p-compression.ccheck_g15g_color_2dpositive + negative matrix) match the policy. - J615 M3 Air G15G hardware rows confirm engagement strictly on 1x 2D plane-0 colour images across 8 CTS groups and
34,336 Pass -> Pass, 0 Fail, 0 GPU faults(with the 4 expectedPass -> NotSupportedhost_image_copy.identical_memory_layouttransitions matching compressed-chip contract), plus Neo G17P34,334 Pass -> Pass, 0 transitions.
Evidence
src/asahi/lib/agx_chip_caps.h: verified all 32 capability bits0..31are distinct (unsignedmask inagx_chip_has_capandtest-chip-caps.c). Note for future PRs: bit 31 fills the 32-bit mask, so the next cap added will require widening touint64_t.src/asahi/vulkan/hk_g17p_compression.h&src/asahi/vulkan/hk_image.c: verifiedcolor_2d_onlyearly rejection and preservation ofAGX_CAP_HAL200_LOSSLESS_COMPRESSIONgates on compute blit / block-mip / shared-modifier / storage paths.- Reported verification at
7ae7f27e: host tests329 Ok / 26 Fail(matching base8bad0a57), J615 G15G A/B34,336 Pass -> Pass / 0 Fail / 0 GPU faults, Neo G17P34,334 Pass -> Pass / 0 transitions(traces/gpu/20261129-gpu-ungate-g15vc/).
|
J713 (M4 Air, G16G) no-change row, saved 7.3.0-aurora-fleet85, isolated ICDs, base 8bad0a5, same list: 21,989 Pass -> Pass, 0 regressions. 6 Fail -> Fail and 4 DeviceLost -> DeviceLost are the same cases on both arms, pre-existing on this older kernel. Restored: Enforcing, 0 failed units. The rows now cover G15G (on), G16G and G17P (unchanged). Traces: traces/gpu/20261129-gpu-ungate-g15vc/j713-g16g. |
|
The 4
A compressed optimal image isn't byte-identical to the host layout, so the driver drops That answers the question I'd asked Dj. With App approval and rows on G15G, G16G and G17P, this is ready for the merge train. |
…15g-color-2d-compression # Conflicts: # src/asahi/lib/agx_chip_caps.h # src/asahi/vulkan/hk_image.c
|
Forward-merged aurora-wip (bb858c3) to clear the conflict. No force push. Two conflicts, both resolved by keeping both sides:
Host tests on the merged tree: 330 Ok / 26 Fail. The 26 are the same set as the previous head; nothing new fails and nothing new passes. The functional diff against base is unchanged from the rowed head 7ae7f27: the only additions are the two merged-in sides above. |
There was a problem hiding this comment.
Verdict: MERGE at bb858c3f
Blockers: none
Checked:
- Audited the forward-merge commit
bb858c3f(origin/aurora-wip082b9e9cinto previously approved7ae7f27e) and full PR diff (+120/-14across 7 files):src/asahi/lib/agx_chip_caps.h: verified every bit0..31inenum agx_chip_capremains unique (AGX_CAP_HAL200_COLOR_2D_COMPRESSION = 1u << 31), andG15Gcleanly preserves bothAGX_CAP_HAL200_COLOR_2D_COMPRESSIONand mergedAGX_CAP_TRI_MERGE_ACROSS_SIDE_EFFECTS(#1347).src/asahi/vulkan/hk_image.c: verifiedVK_IMAGE_LAYOUT_ZERO_INITIALIZED_EXTearly-out (!hk_chip_zeroed_compression_reads_zero(dev->chip)) remains ahead of the AGX3 compression path, so zero-initialized images stay plain on G15G just like G16G/G17P.- Confirmed the functional diff against
aurora-wip(agx_chip_caps.h,test-chip-caps.c,hk_g17p_compression.h,hk_image.c,test-hk-compression-contract.c,test-hk-g16s-compression.c,test-hk-g17p-compression.c) is unchanged from7ae7f27e.
- Verified host tests at
bb858c3f(330 Ok / 26 Fail, identical pre-existing baseline) and carry-over of the multi-chip hardware rows (J615G15G34,336Pass -> Pass /0Fail /0GPU faults with the 4 expectedhost_image_copy.identical_memory_layoutPass -> NotSupportedmatching G16G/G17P;J713G16G21,989Pass -> Pass /0regressions; G17P unchanged). - Confirmed DCO
Signed-off-byon feature commit7ae7f27eandMERGEABLEonaurora-wip.
Evidence
bb858c3f5595deb02b5500289282527aa6efacfc: merge oforigin/aurora-wip(082b9e9c) onto7ae7f27e, resolving onlysrc/asahi/lib/agx_chip_caps.handsrc/asahi/vulkan/hk_image.cby retaining both sides.- Verified all 32 enum bits (
1u << 0through1u << 31) insrc/asahi/lib/agx_chip_caps.hatbb858c3fhave zero collisions.
|
@DjDeveloperr, code-owner heads-up: App approval at |
|
Merge-train landing at
Revert: |
Borealis twin of #1341: lossless compression for G15G (M3) private colour images. The design was agreed with Dj on the agents channel.
What changes
AGX_CAP_HAL200_COLOR_2D_COMPRESSION(bit 31): the private single-sample colour subset of the HAL200/Gen9 policy. G15G gets only this cap;AGX_CAP_HAL200_LOSSLESS_COMPRESSIONimplies it. The GL predicate (agx_chip_gen9_color_compression()) stays independent.hk_hal200_compression_eligible()with only the narrow cap admits plane 0 of an optimal 1x 2D image with one level and one layer, in the existing 1-8B colour allowlist, with noCUBE_COMPATIBLE. The common usage, flag, store-class, import/WSI and sparse checks still apply.hk_cmd_meta.c:2257), its pair-store shortcut (:2965) and the direct compressed block-mip store (hk_g17p_meta_copy_core.h:277) keep their HAL200 gates. G15G copies take the existing compressed-image graphics fallback.hk_image.c:610(M5 storage) and:1267(cube) need nothing.check_g15g_color_2d: positive 1x 2D. Negative: plane 1, mips, layers, MSAA, linear, cube, 3D, 16-byte, storage, external memory, D32, D32S8 (both planes), G15S/G15C.Rows (J615, MacBook Air M3, G15G, saved 7.3.0-aurora-edge, isolated ICDs; base aurora-wip 8bad0a5)
Host tests: 329 Ok / 26 Fail, the same 26 as base.
Engagement, debug ICD that prints every compressed image. Every compressed image is
samples=1 plane=0 2D levels=1 layers=1, a colour format (R8G8B8A8_UNORM here), and all cases pass.A/B on the same list Dj asked for:
There are 4 Pass -> NotSupported, all
host_image_copy.identical_memory_layout.optimal.{r16_sfloat,r16_unorm,r16g16_uint,r8g8b8a8_unorm}("identicalMemoryLayout not supported for this format"). Host image copy now reportsidenticalMemoryLayoutfalse for formats whose optimal images can be compressed. That's the same contract the chips that already compress report (query_hic_detects_compressionin the contract test).Neo (G17P) no-change: 34,334 Pass -> Pass, 0 transitions. J713 (G16G): row to follow when the Mac is free.
Restored: Enforcing, 0 failed units. Traces: traces/gpu/20261129-gpu-ungate-g15vc/{j615-g15g,j615-g15g-ab,neo-g17p} (kit kits/test/20261129-gpu-ungate-g15vc).