A video cache's planes took their fill at their make: a clear of each on the
transfer queue, which the first decode op into each new surface then waited
for on its thread before the hardware could write. A macOS guest's walk of
1080p H.264 and HEVC and 4K 10-bit HEVC measured that wait at every new 4K
10-bit surface's first op on a Radeon 780M over VA-API, 14 of 14, 1.9 ms at
the median and 2.6 ms at most (26.1 ms in all), and on 12 of 14 on an RTX
3090 over NVDEC (0.23 ms, 0.32 ms at most); 4 of 21 and 7 of 28 of the 1080p
surfaces' first ops waited, up to 0.9 ms.
The planes now owe their fill as any new shape does. A decode that takes a
new cache's first fill as met takes the planes' fills as met too, on every
host (on Windows it did already), so its begin fills nothing and its op
waits for no fill. The guest reads the same zeros wherever no picture
lands:
- a picture short of the planes has the host's video zero the rest
(the commit before this one);
- a picture that fails to land in planes whose fill its decode took has
them cleared whole by the session, on its queue, before its value is
signalled (SurfaceTarget::zeros);
- a decode op that fails, at any step after its command buffer's begin,
makes the cache's fill from its pages, as one that answers no picture
does (Caches::decode_failed);
- planes that a video command buffer landed no picture in owe a fill from
the buffer, which a use makes by clearing them where the buffer holds no
memory, from the surface's own clear passes, rather than making the
buffer's memory to copy its zeros: SurfaceCaches::fill_shapes now clears
wherever the fill at the planes' make did.
What changes for the guest: a decode's first picture into a new surface
starts without that wait. A picture that fails to land in a new surface
now leaves its planes all zeros, where the hardware's partial write over
the make's zeros showed before. The counts line names the plane fills a
decode took ("taken as met by a decode over zeros"); its "filled at their
make" and "owing theirs past their make" counts are gone.
Tests: the tests that held the fill at the make now hold the planes owing
it and the decode taking it, with no wait (surface_shapes); new tests hold
the clears of planes no picture landed in, and a failed landing's clears
(video_host).