From: Christian König Date: Thu, 26 Mar 2015 13:49:18 +0000 (+0100) Subject: gallium/vl: partially revert "Use util_cpu_to_le{16,32} in many more places." X-Git-Tag: upstream/17.1.0~19781 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=787aa26cb7b48504f7770cacfc321324ecafa29a;p=platform%2Fupstream%2Fmesa.git gallium/vl: partially revert "Use util_cpu_to_le{16,32} in many more places." The data in memory is in big endian format and needs to be converted into CPU byte order. So the patch actually reversed what needs to be done. Signed-off-by: Christian König Reviewed-by: Matt Turner --- diff --git a/src/gallium/auxiliary/vl/vl_vlc.h b/src/gallium/auxiliary/vl/vl_vlc.h index cad9989..2f90595 100644 --- a/src/gallium/auxiliary/vl/vl_vlc.h +++ b/src/gallium/auxiliary/vl/vl_vlc.h @@ -149,7 +149,11 @@ vl_vlc_fillbits(struct vl_vlc *vlc) } else if (bytes_left >= 4) { /* enough bytes in buffer, read in a whole dword */ - uint64_t value = util_cpu_to_le32(*(const uint32_t*)vlc->data); + uint64_t value = *(const uint32_t*)vlc->data; + +#ifndef PIPE_ARCH_BIG_ENDIAN + value = util_bswap32(value); +#endif vlc->buffer |= value << vlc->invalid_bits; vlc->data += 4;