Files
reims-vgpu/crates
Anees Iqbal 8085256b3e 🆕 Align IOSurface plane offsets to the GPU's linear images too
The kext had IOSurface align the bytes per row it works out to the host GPU's
linear alignment, but left the plane offsets it works out at IOSurface's own
64 bytes. A GPU's linear image of a plane starts only where its memory
alignment allows: on RADV the driver refuses a DRM_FORMAT_MOD_LINEAR plane
off 256 bytes, and the XTX baseline walk (m3-max-19850) shows textures over
planes at offsets 32 and 256 of a page shadowed for it. The host's answer,
the runtime's minimum_linear_texture_alignment_for_pixel_format, is the
alignment of a texture's offset and rows at which the device's images hold
it in place (its memory requirements' alignment divides it).

What the guest sees: where the host answers linear_row_alignment above 64
(256 on RADV, 128 on NVIDIA), IOSurface aligns the plane offsets it works out
to it as it does the bytes per row, and IOSurfaceGetPropertyAlignment of
kIOSurfacePlaneOffset answers it. Planes a client places itself, as
CoreVideo's first plane 32 bytes into its surface, are as they were and take
a device cache at their ask.
2026-11-12 03:39:50 -08:00
..