i965: add support for multisample textures

This is a bit nasty -- I've just (ab)used the existing multisample
renderbuffer path.

Also put the actual sample count from the mt back into the
renderbuffer so core mesa can see what the driver actually gave it.

V2: - fix for state moving from texobj to image
    - rebased onto Paul's logical/physical cleanup
    - fixed missing quantization of sample count

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: gen6: set multisample mode in surface_state

When setting up surface_state for texturing, set the multisample mode.
Surface_state used for render targets was already correct.

V2: Clarify commit message; rebased onto Paul's physical/logical dims
cleanup.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: fix renderbuffer wrapper setup for multisample textures

Previously we were putting the 2x2 (or 4x2) fake dimensions of the
surface into the renderbuffer wrapper. This is different from how
other parts of the driver expect multisample renderbuffers to be set up,
and produced stalls and memory stomps.

Pulls multisample textures into line with classic multisample
renderbuffers, fixing the arb_texture_multisample-sample-mask-execution
-tex piglit.

V2: Rebased onto Paul's physical/logical dims cleanup

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965/vs: emit sample index for txf

When fetching texels from a multisample surface, the sample index is
provided as an extra argument after the lod, and the actual lod needs
to be hardwired to 0.

The frontend gives us the sample index in the lod parameter, so fix this
up.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965/fs: emit sample index for txf

When fetching texels from a multisample surface, the sample index is
provided as an extra argument after the lod, and the actual lod needs
to be hardwired to 0.

The frontend gives us the sample index in the lod parameter, so fix this
up.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: enable ARB_texture_multisample on Gen6

There are a few things that need to be done to support Gen7+ as well,
but I don't have a machine available to test them.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>