Files
reims-vgpu/docs/graphics-kext
Anees Iqbal 7a98159ca2 🐛 Owe a refill from each read-write lock, whatever filled the cache
A cached surface's device cache could hold the pages as they were mid-write
with no refill ever asked: the bundle recorded the surface's unlock seed only
as a commit first named a generation, so a fill the bundle never saw (a
present's, the first fill a block owes, a block named again) made while the
CPU held its read-write lock stood until the next lock. Such a present also
left the record to be made after the unlock, which then never asked.

The kext now writes each generation's refill record into the block's header
itself, as it caches the block and at each read-write lock, before the
generation, with the surface's unlock seed then (RgfxSurfaceRefill.hpp,
which the bundle shares). The first commit, in any process, once the unlock
seed has moved past the record's carries RGFX_SURFACE_USE_REFILL and settles
it; a commit while the lock is held or being taken asks nothing and leaves it
owed. For the host: a use after each read-write lock's unlock now carries the
flag, including the first use of that generation; the host ignores it where
the cache holds an older generation, as before, so a generation never filled
mid-write costs no extra fill. The record is one 64-bit word written by
compare-and-swap, so a holder never writes over a newer generation's record.
2026-11-20 16:26:09 -08:00
..