What I had before was a R32 texture rendering the depth like this:
viewPos.z / farClipDist
And inside the ssao I sample from this texture two times using different tex coords.
Now when I sample from my hw depth stencil buffer and then convert it the way you described it, it just gives me a grey screen.
Edit: Ah it does work it was my projection matrix that was wrong somehow.
Thanks for the solution !