The setup_program function in brw_meta_stencil_blit.c (http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c#n282) can only generate shader variations for GL_TEXTURE_2D and GL_TEXTURE_2D_MULTISAMPLE. However, if I add an assertion
assert(target == GL_TEXTURE_2D || target == GL_TEXTURE_2D_MULTISAMPLE);
at the single caller of the function, the arb_stencil_texturing-blit_corrupts_state test (http://patchwork.freedesktop.org/patch/70427/) fails the assertion for every other target. That indicates to me that blits from those other targets probably don't work.
We need a test like arb_stencil_texturing-blit_corrupts_state that verifies the result of blitting from every possible texture target. It shouldn't be too hard to adapt the existing arb_stencil_texturing-draw test.
And... that is the only test that fails the assertion. :(
Looking back at the GIT history, it appears that GL_TEXTURE_2D and GL_TEXTURE_2D_MULTISAMPLE
Looking back at the GIT history, it appears that GL_TEXTURE_2D and GL_TEXTURE_2D_MULTISAMPLE were the only targets supported when GL_ARB_stencil_texturing did not exist. A renderbuffer was the only way to get stencil because internally we use separate stencil on these GENs even for packed depth / stencil targets. _mesa_meta_bind_rb_as_tex_image would only generate those two targets.
When support for GL_ARB_stencil_texturing was added for GEN8+, we had only one test in piglit. It didn't hit the non-GL_TEXTURE_2D* path, so nobody noticed.
Inspecting brw_meta_stencil_blit, I believe it is also broken for blitting to anything other than the mipmap 0.