frontends/va: Encode DPB surfaces + allocate surface buffers on demand
What does this MR do and why?
Saves memory by not allocating DPB surface buffers for encode when driver doesn't use them. At 8K 10bit HEVC encoding, this saves around 500MB with FFmpeg. Also makes it possible for drivers to actually use (and allocate) these buffers, if needed.
Originally I wanted to have the same also for decode, but I don't think we can do it there. There are applications that will allocate the buffers externally, import to VASurface and then request to decode into, so for decode it can't be (re)allocated internally by drivers. One example app that does this is chromium.
For encode, this is not a concern because the surfaces are not supposed to be used in any other way than for reconstructed pics. And even if some app tried to use them, it would currently get empty buffer anyway.