TTM Multihop Code Revised For Improving Linux GPU Buffer Management
Airlie has been working on patches in recent weeks to extend the TTM memory management infrastructure with a "multihop" feature. Right now when needing to move a buffer temporarily across address spaces such as from system RAM to/from video RAM, the driver functions are called upon that add further complexity to the driver code. TTM Multihop allows the core TTM memory management code handle this temporary placement of buffers to/from vRAM to sRAM in order to avoid call stack issues with existing path of the drivers handling it.
TTM Multihop adds around five dozen lines of code to the core TTM code but then removing the existing functionality in each driver saves 100+ lines of code. AMDGPU, for example, in transitioning to TTM Multihop drops 136 lines of code from the driver in using the common functionality. The Radeon and Nouveau DRM drivers are also adapted to use this multihop code and in turn see similar L.O.C. reductions.
The latest TTM Multihop patches were published this weekend on dri-devel.