r600g: add missing case for uint->flt conversion.

fixes some piglits like vs-decrement-uint.shader_test

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 55bd1c8365baa5f21e79eace2bbce1413e38bfb8)
r600g: fix r600 f2i to be trans only emitted.

This fixes a lot of asserts about the trans unit being used already.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit bfcffd4d721d87bb6287980a09e0296ceed0bba3)
r600g: add r600 version of UINT_TO_FLT conversion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit faa90abfe0b6f55ab69768eb930b4ab5ef21cb06)
r600g: make u2f trans only

as per the r600 isa doc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 9a401a2fd6c2d9aa07402e33493be3f014c0fe10)
r600g: fix mullo_uint trans slot only on r600/r700

This fixes 8 piglit tests that currently assert.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 850021f225f312d55fb6a24a8cef805f527510af)
i915g: Fix the blending for the A8 destination buffer case.

The i915 GPU can't do A8 dst, so we abuse GREEN8 buffers for that
purpose. However, things get hairy as we start to do blending,
because then GL_DST_*_ALPHA should be replaced with GL_DST_*_COLOR.
This is what we do here.

Fixes piglt fbo-alpha.
(cherry picked from commit 23d4a0569dcb70bdfd748bf7e1f5102289bfad6b)
r600g: fix USLT for r600-eg
(cherry picked from commit 7383e754b70414b35c10c216034a8dc95f6f67b4)

Conflicts:

	src/gallium/drivers/r600/r600_shader.c

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
r600g: fix recip_uint on r600.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit ba59a1a0d817566576e20e66d74f1917d958119e)
r200: fix fog coordinate emit

Noticed by dungeon on phoronix:
http://phoronix.com/forums/showthread.php?65408-Radeon-R100-R200-Mesa-Driver-Sees-Attention&p=247018#post247018

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
(cherry picked from commit afdd6f8c34705eae5048da03329750836bcecf44)
radeon: fix fog coordinate emit

Noticed by dungeon on phoronix:
http://phoronix.com/forums/showthread.php?65408-Radeon-R100-R200-Mesa-Driver-Sees-Attention&p=247018#post247018

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
(cherry picked from commit e77c495d09105a1b6a13fd62d0d3585b019e1c66)
r600g: fix UINT_TO_FLT on evergreen

It should be processed as trans-only.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit b69728cba53765f6799a66ebcab2058be6d53602)

Conflicts:

	src/gallium/drivers/r600/r600_shader.c

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
r600g: fix some of the interpolation tests.

This enables linear gradients if we need a linear,
it also sets the flat shade flag for color/constant interpolations.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 1fc001ea15f79166a32bc3a3fa2f6405a986e3f1)
r600g: make r600/700 use correct ineg.

Noticed by Vadim Girlin on irc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 5893e686b691013525cb2608c3d605be2d8ea471)
r600g: fix ISLT on r600/700

This fixes ISLT like evergreen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 0196433ce55b7e005c483bd7c411844eb44e983b)

Conflicts:

	src/gallium/drivers/r600/r600_shader.c

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers

when mapping renderbuffers or texture images.

NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 84c7c14697c82fe25586f8186b4f47d80a6f05f9)
svga: add 0.5 in float->int conversion of sample min/max lod

This makes lod clamping more consistent with other drivers.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 5abcd198b8e644c0d97c6766c6707e20fe22f0fb)
svga: fix min/max lod clamping

The interaction between the mipmap lod min/max limits and the texture
base/max level limits is kind of tricky.  Changing the base level
didn't work as expected before.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit fd890873b20de553078fc96d977fbd858238c7d9)
svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0

The legal range for the device is apparently [-16.0, +15.0].
Limiting the range to [-15, +15] fixes piglit's lodbias test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit a9eda41539bd63ed1835556ad3afc77ee01f6a6a)
st/dri: Remove useless flush front.

In the following scenario:
- CreateContext C1
- MakeCurrent C1
- DestroyContext C1 (does not actually destroy the first context, postponed
 until the next MakeCurrent)
 - CreateContext C2
 - MakeCurrent C2
MakeCurrent will call flush on a half destroyed context, leading to crashes.
Since the other paths (destroy and makecurrent) already flush the context,
there is no need to flush here, so we remove this useless flush front call.

This fixes GPU crashes with Chrome and gallium drivers.
(cherry picked from commit 81da773f841aa69debc473537750c475e6261e37)
i915g: Don't invert signalled/unsignalled fences

NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 2b4afdba05abe3408f6347be82465b6420f50aab)