This doesn't seem to work anymore with mesa 19.x; an updated patch is available at the Debian packaging repo.
And here's a patch from Vincent Fourmond.
Failures in headless mode