This just ports the last patch I posted to be a pure radv patch, it doesn't add the radeonsi bits to it at this stage. I think I'd prefer to land this and then we can work on understanding how best to add the same features to radeonsi without causing any possible regressions or driver specific code in the shared codebase.