Repository navigation
asahi,hk: scan out compressed interchange on Gen9 descriptors (8-bit and 10-bit) - #183
Conversation
100959a to
fc75496
Compare
|
Rebased onto current Disclosure: prepared with an AI tool (the commit carries Assisted-by: LLM); tested on my M4 Max as described. |
|
Thanks for the rebase and the pitch/bounds test. Since this applies to every G17P machine, we can run the interchange path on an A18 Pro and an M4 Pro (internal panel, offscreen GL checks, a scroll/power before-and-after on the current base) if you'd like rows from more than the M4 Max. Just say when the head is final. |
|
Blockers: 3.
What I checked: the WSI pitch change and the new bound in test-layout.cpp agree with HW row: this rebased head. On the M4 Max internal panel: scrolling and animation power against aurora-wip, offscreen GL checks identical, 0 GPU faults. On the A18 Pro: the same panel check. On one non-G17P Mac (M2): the dmabuf modifier list and a desktop session unchanged. 0 new kernel errors and 0 failed units on all three. Assisted-by: LLM (Claude:Opus 5.5) |
fc75496 to
aa5eaf4
Compare
|
Addressed all three code/hygiene blockers in
Assisted-by: LLM (Google:Gemini 4 Neon) |
fe208e5 to
3d963c0
Compare
|
Rebased onto Host verification ( Assisted-by: LLM (Google:Gemini 4 Neon) |
|
Thanks for the update. Checked 3d963c0 (the delta from aa5eaf4 is only the #708 conflict resolution). From my last review:
Remaining:
Hardware: there are no rows at 3d963c0 yet. On the A18 Pro, appledrm offers only LINEAR on the internal panel, so it would only confirm the fallback. The M4 Pro is the second G17P display that takes interchange. Rows that would cover this head: M4 Max and M4 Pro internal panels (KMS modifier shows interchange, offscreen GL identical, scroll power against aurora-wip, 0 GPU faults), plus one AGX2 Mac (M2) with the dmabuf modifier list and a desktop session unchanged. If the gate stays at Gen9, it also needs a row on an M3 Pro/Max or another non-G17P Gen9 machine whose display offers interchange. Assisted-by: LLM (Claude:Opus 5.5) |
|
M4 Pro (J616s, T6040, G17P) row against base, one boot of the default fleet kernel (7.3.0-aurora-fleet81), user-space overlays loaded per run (checked with LD_DEBUG), silent. Head 3d963c0 vs base 2fa7180. The compositor uses the system Mesa, so an overlay can't change the scanout path, and I didn't take a panel CRC. I checked the modifier lists instead:
So on M4 Pro the new modifier is advertised by both sides. A real scanout test (an installed build, compositor on the internal panel, screenshot vs base) is still open, and so is the shared-capability point from my last comment. Assisted-by: LLM (Claude:Opus 5.5) |
|
Updated
Assisted-by: LLM (Anthropic:Claude Opus 5.5, Google:Gemini 4 Neon) |
3d963c0 to
96f9b12
Compare
|
Checked 96f9b12 against my last review on 3d963c0. Fixed:
Not as described:
Tests:
Effect on other chips:
Hardware: no rows at 96f9b12 yet. The M4 Max numbers in the body are from the 5 Nov build and
Assisted-by: LLM (Claude:Opus 5.5) |
96f9b12 to
78ebc97
Compare
|
Rebased onto
Fresh J616C compositor/scanout row at Assisted-by: LLM (Google:Gemini 4 Neon) |
|
Checked 78ebc97 against my review of 96f9b12. Apart from the rebase onto 27ef0e8 (the Fixed:
Still open, hardware only (no rows at 78ebc97 yet):
No code changes needed from me. Once those rows are in at this head, this is fine from my side. Assisted-by: LLM (Claude:Opus 5.5) |
78ebc97 to
cd53c06
Compare
|
Rebased cleanly onto Assisted-by: LLM (Google:Gemini 4 Neon) |
cd53c06 to
7168ff0
Compare
|
Rebased onto Assisted-by: LLM (Google:Gemini 4 Neon) |
|
J616C (Apple MacBook Pro 16", M4 Max, 32-core T6041, Fix Included in
|
7168ff0 to
ce2e587
Compare
|
Rebased cleanly onto Assisted-by: LLM (Google:Gemini 4 Neon) |
5787c01 to
e8c9662
Compare
e8c9662 to
1c766c1
Compare
A window that can't scan out GPU tiling got LINEAR: 30.9 MB written and read by the display every frame, about 3.7 GB/s each way at 120 Hz. Offer DRM_FORMAT_MOD_APPLE_INTERCHANGE for plain 32-bit 2D buffers on chips with the shared AGX_CAP_GEN9_2D_COMPRESSION capability in agx_chip_caps.h (currently G17P), so it wins against LINEAR in a display modifier list and nothing else. Put Gallium private 2D depth compression, Borealis interchange, and Gallium interchange behind AGX_CAP_GEN9_2D_COMPRESSION so they cannot drift apart across Gen9 parts (private Gen9 colour compression continues to be gated by agx_chip_gen9_color_compression() for G16G and G17P). Texture and PBE descriptors now carry its stride on Gen9, the native descriptor gate admits it, the pitch is per pixel row because DRM core checks pitch * height, and metadata is padded to the power-of-two size appledrm expects. The layout test's interchange check expects that pitch. Filter agx_query_dmabuf_modifiers(), agx_is_dmabuf_modifier_supported(), and agx_resource_from_handle() through the same capability and format predicate so chips without AGX_CAP_GEN9_2D_COMPRESSION and unsupported formats keep their existing modifier list. Keep DRM_FORMAT_MOD_APPLE_INTERCHANGE non-external-only so compositors that render to GBM scanout BOs imported as EGLImage FBOs can select it, while guarding agx_decompress() and writable storage-image descriptor uploads specifically for shared compressed Interchange resources and guarding agx_shadow(), agx_legalize_feedback_loop_surf(), and spilled-RT paths with agx_resource_is_shared(), failing closed via batch rejection on incompatible compressed views (sampled, storage, or render-target background/end-of-tile) or writable Interchange storage images instead of reallocating and detaching a shared BO or aborting. Exclude Interchange and AGX3 shared compressed targets from agx_fast_clear_surface_eligible() so scanout clears stay on the VDM+PBE path. Measured on the M4 Max internal panel at 120 Hz: scrolling 12.7 W to 11.9 W, memory rail 4.96 W to 4.36 W. Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
Extend DRM_FORMAT_MOD_APPLE_INTERCHANGE compressed 2D scanout on Gen9 2D compression chips (G17P) from 8-bit RGB/RGBA to 10-bit 32-bpp RGB/RGBA: - Gallium asahi: admit B10G10R10A2_UNORM, B10G10R10X2_UNORM, R10G10B10A2_UNORM, and R10G10B10X2_UNORM in agx_interchange_format(). - Borealis Vulkan: admit VK_FORMAT_A2R10G10B10_UNORM_PACK32 and VK_FORMAT_A2B10G10R10_UNORM_PACK32 in the Borealis Interchange format predicate. All 32-bpp 10-bit formats have 4-byte texels matching ail_initialize_interchange() (16x16 macroblocks, 1024-byte tile stride, 8-byte metadata tiles, matching appledrm apple_get_ix_layout() for XR30/AR30 DCP_FORMAT_L10R) and share Gen9 compressed PBE/texture channel class 0x26 (AGX_CHANNELS_R10G10B10A2). Fix AGX3 tilebuffer and PBE handling for 10-bit void-alpha formats (B10G10R10X2_UNORM / R10G10B10X2_UNORM): - Pad 3-component AIL_ISA_FORMAT_RGB10A2 stores with 1.0 alpha in agx_nir_lower_tilebuffer.c on G17P/M5 (lower_g17p_formats), and accept 3-component RGB10A2 pack (filling lane 3 with 1.0f) and 1..4-component RGB10A2 unpack in agx_compile.c, so X2 clears, reloads, draws, blends, and zero-mask preserves compile cleanly instead of refusing 3-channel packed tile ops. - Prevent agx_opt_compact_constants from narrowing 32-bit float constants feeding AGX3 FLTNORM_AGX3 / PACK_RGB10A2_AGX3 to 16-bit registers. - Point AGX3 PBE swizzle_a at tile channel 3 (0b11) for void-alpha R10G10B10A2 targets in agx_state.c so X2 bits store opaque alpha instead of tile channel 0 (red). - Reject AGX_LAYOUT_INTERCHANGE on Gen10 texture descriptors (Gallium and Borealis) and reject uncompressed Interchange PBE descriptors in Borealis. Add host unit tests covering 8-bit and 10-bit Interchange layout, modifier admission/queries (including FP16/UINT non-advertisement), Gen9 compressed PBE and texture descriptors, and Gallium 10-bit A2/X2 scanout allocation, fast-clear CDM exclusion, and clear+blend compilation. Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
1c766c1 to
ec79156
Compare
satchlj
left a comment
There was a problem hiding this comment.
Verdict at ec791567c7d0
Approve. Enabling Gen9 2D compressed interchange scanout (8-bit and 10-bit RGB/XRGB) behind AGX_CAP_GEN9_2D_COMPRESSION, wiring the tiling_config / page_aligned_layers / compressed_interchange / swizzle_a descriptor fields across libasahi, Gallium, and Vulkan, and covering all 5 chip targets with drm-shim shared-BO tests plus descriptor/compression contract tests are clean and pass unit and live Apple M5 Max Vulkan + Gallium GLES3 10-bit verification without faults.
Blockers
None.
Checked
- Audited all 23 changed files (
+1593/-81), confirmingail_initialize_interchange()setslayout->stride_el[0] = DIV_ROUND_UP(width_px, 16) * 16matching the PBE/texturetiling_configstride expressions inagx_state.c,AGX_CAP_GEN9_2D_COMPRESSIONstays gated toAGX_CAPS_G17P, and the 10-bitUTIL_FORMAT_TYPE_VOIDalphaswizzle_a = 3path inagx_batch_upload_pbe_internalcleanly coversagx_chip_native_or_m5. - CI on
aurora-silicon/mesa: no PR status checks configured on this repo. - Local build (
-Dbuildtype=release -Db_ndebug=false -Dtools=drm-shim) applied cleanly ontoorigin/aurora-wip(d5d67353ae1c), Meson--suite asahi --suite poly: 300/300 OK, including:asahi-g13g-gallium-interchange-shared-bo,asahi-g15g-gallium-interchange-shared-bo,asahi-g16g-gallium-interchange-shared-bo,asahi-g17p-gallium-interchange-shared-bo,asahi-t6041-gallium-interchange-shared-bo(5/5 OK)hk_compression_contract,hk_native_descriptor,asahi-native-descriptor,hk_g17p_compression,hk_g16s_compression,agx3_layout,agx_m5_layout,asahi_layout_tests(all OK)
- Live Apple M5 Max Vulkan & Gallium GLES3 verification (
MESA_SHADER_CACHE_DISABLE=true, private install prefix for GLES3 surfaceless FBO):dEQP-VK.api.smoke.*: 8/8 Passed, 0 FaileddEQP-VK.drm_format_modifiers.*: 870/1572 Passed, 0 Failed, 702 Not supporteddEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.2d.a2b10g10r10_unorm_pack32.a2r10g10b10_unorm_pack32.*: 8/12 Passed, 0 Failed, 4 Not supporteddEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.2d.a2r10g10b10_unorm_pack32.b8g8r8a8_unorm.*: 8/12 Passed, 0 Failed, 4 Not supporteddEQP-GLES3.functional.fbo.color.tex2d.rgb10_a2*: 2/2 Passed, 0 FaileddEQP-GLES3.functional.fbo.render.shared_colorbuffer.rbo_rgb10_a2*: 3/3 Passed, 0 FaileddEQP-GLES3.functional.texture.format.sized.2d.rgb10_a2*: 4/4 Passed, 0 FaileddEQP-GLES3.functional.fbo.color.tex2d.rgba8*: 3/3 Passed, 0 Failed- Kernel GPU fault delta: 0
- Untested scope: live physical display scanout via DCP/Wayland compositor on a G17P device (Gen9 2D compression is enabled on
AGX_CAPS_G17P, not Gen10 M5; verified viag17p/t6041drm-shim tests and contract tests).
Evidence
Meson (--suite asahi --suite poly, -Dbuildtype=release -Db_ndebug=false -Dtools=drm-shim): Ok: 300, Fail: 0
- asahi-g13g-gallium-interchange-shared-bo: OK
- asahi-g15g-gallium-interchange-shared-bo: OK
- asahi-g16g-gallium-interchange-shared-bo: OK
- asahi-g17p-gallium-interchange-shared-bo: OK
- asahi-t6041-gallium-interchange-shared-bo: OK
- hk_compression_contract / hk_native_descriptor / asahi-native-descriptor: OK
dEQP-VK.api.smoke.*: 8/8 Passed
dEQP-VK.drm_format_modifiers.*: 870/1572 Passed, 0 Failed, 702 Not supported
dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.2d.a2b10g10r10_unorm_pack32.a2r10g10b10_unorm_pack32.*: 8/12 Passed, 0 Failed, 4 Not supported
dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.2d.a2r10g10b10_unorm_pack32.b8g8r8a8_unorm.*: 8/12 Passed, 0 Failed, 4 Not supported
dEQP-GLES3.functional.fbo.color.tex2d.rgb10_a2*: 2/2 Passed
dEQP-GLES3.functional.fbo.render.shared_colorbuffer.rbo_rgb10_a2*: 3/3 Passed
dEQP-GLES3.functional.texture.format.sized.2d.rgb10_a2*: 4/4 Passed
dEQP-GLES3.functional.fbo.color.tex2d.rgba8*: 3/3 Passed
GPU fault delta: 0
|
|
What:
Enable compressed
APPLE_INTERCHANGEscanout on Gen9 2D compression chips (G17P / M4 Max, M5) across Asahi Gallium and extend compressed interchange scanout to 10-bit RGB (XRGB2101010/ARGB2101010/XBGR2101010/ABGR2101010) in both Asahi Gallium and Borealis Vulkan:828bbb5955a4): Allow Gen9 2D compression chips to advertise and scan out compressedAPPLE_INTERCHANGEbuffers in Asahi Gallium, guarding fast-clear and cross-chip storage-image constraints cleanly.ec791567c7d0): Extend compressed interchange scanout support to 10-bit RGB formats in both Asahi Gallium and Borealis Vulkan (asahi,borealis:rebased cleanly pastmesa#641,mesa#745, andmesa#978ontoaurora-wip9a21c0c6220a).Tested:
-Db_ndebug=false, atec791567c7d0): 194/194 PASS (0 failed).T6041/G17P,7.3.0-j616c-p3dcp+, Display P3 10-bitXRGB2101010active oneDP-1, installed to/opt/aurora-mesa,libgallium PT_TLS=56B,dlopenOK):git-ec791567c7):OpenGL 4.6 (Core & Compatibility)+OpenGL ES 3.2onApple M4 Max (G16C B1);glmark2-wayland[build]6209 FPS /[shading]5772 FPS (score 5989).git-ec791567c7,MESA_SHADER_CACHE_DISABLE=true):render.deferred d=1,2(229.2 us,valid=true,crc=2cfe9a54),render.postfx d=1,2(valid=true,crc=4707efa8),compute.conv2d d=1,4(valid=true,crc=2d55a14d),compute.uber d=1,4(valid=true,crc=9963f56c).0GPU faults indmesg,0failed system/user units,max-health.shPASS.Not yet:
ec791567c7d0.Risk:
two-way · Gen9 2D compression Macs (M4 Pro/Max G17P, M5, Neo) running compressed scanout and 10-bit RGB display output (plain revert restores uncompressed scanout).