pipebuffer: Reapply the mesa_7_7_branch's changes.

After the last mesa_7_7_branch merge the old master code remained,
instead of the newer mesa_7_7_branch's code. This commit makes both
branches match, modulo interface changes.

Note: future mesa_7_7_branch -> master merges will most likely hit
conflicts in these files. Unless otherwise stated, the mesa_7_7_branch
is the reference.
2 files changed