Tested with R600, radeonsi, i965.
Created attachment 118576 [details]
This issue is already fixed upstream, and will be part of the next Xorg 1.18 release: http://cgit.freedesktop.org/xorg/xserver/commit/?id=2d7194334a9f84e417ec90e220b2fe476f704612
I also just asked for its inclusion in the next 1.17 release: http://lists.x.org/archives/xorg-devel/2015-October/047634.html
Until the release of the next 1.17 or 1.18 version, you can either cherry-pick this commit, or build Xorg master instead.