etna_try_blt_blit(..) derived the BLT sRGB decode (on read) and encode
(on write) flags independently from the source and destination formats.
A copy between two sRGB formats - such as the glReadPixels resolve of an
SRGB8_ALPHA8 framebuffer - therefore decoded to linear and re-encoded.
That roundtrip through the hardware is not bit-preserving and loses up
to 2/255 at low values, corrupting the readback of the conversions
r32f, rg32f and rgba32f to srgb8_alpha8.
Apply the sRGB conversion only when the copy crosses the sRGB/linear
boundary. Same-encoding copies stay a plain bit copy.
Fixes dEQP-GLES3.functional.fbo.blit.conversion.{r32f,rg32f,rgba32f}_to_srgb8_alpha8
Fixes: 99400f272d ("etnaviv: blt: Add BLT format conversion support")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41892>