Skip to content

d3d12, frontend/va: Direct DPB rework

Sil Vilerino requested to merge sivileri/mesa:d3d12_direct_dpb into main

What does this MR do and why?

  • Implements direct DPB management from frontend/va in d3d12 gallium video driver. This should give us some memory savings (e.g no more both the app and the driver allocating DPB buffers), as well as some more features "for free" like long term reference frames.

    • Based on this previous work:
    • First implement create_dpb_buffer. For Array Of Textures is pretty straightforward, just add new bind flags for decode/encode and have the driver set those flags. For Texture Array, we keep an initial pool of "slots" in a texture array and give out unused slots when the frontends requests an allocation. Lastly, we mark the slot as unused when the frontend destroys the buffer, and destroy the pool allocation once no more slots are used.
    • Make H264/HEVC encode use all the DPB/mmco(H264)/L0/L1/etc and some header related params directly from the frontend, instead of tracking it ourselves
    • Don't do any DPB texture tracking or use internal DPB allocations, directly use the ones given by the frontend.
  • Implements get_feedback_fence after it was removed in !30780 (merged) due to refactoring

    • Adds capabilities to get the encoding fence through the pipe picture params as other entrypoints
    • Adds capabilities to properly implement the timeout parameter in frontends/va on VaSyncSurface and VaSyncBuffer
    • Also adds a minor bugfix in frontend/va regarding the encoder feedback/fence

cc @nowrep @jenatali

Edited by Sil Vilerino

Merge request reports