From 54ad3dfaaa087980f27fee3aa597472478e54a31 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 17 Jun 2013 23:21:23 +0000 Subject: [PATCH] byteswap.h and bswap_32 aren't portable, replace them with calls to gallium's util_bswap32 as suggested by kettenis. already merged upstream ok kettenis@ --- dist/Mesa/src/gallium/drivers/r600/r600_asm.c | 4 ++-- dist/Mesa/src/gallium/drivers/r600/r600_buffer.c | 4 +--- dist/Mesa/src/gallium/drivers/r600/r600_shader.c | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/dist/Mesa/src/gallium/drivers/r600/r600_asm.c b/dist/Mesa/src/gallium/drivers/r600/r600_asm.c index 34c5ae4bf..909566957 100644 --- a/dist/Mesa/src/gallium/drivers/r600/r600_asm.c +++ b/dist/Mesa/src/gallium/drivers/r600/r600_asm.c @@ -22,9 +22,9 @@ */ #include #include -#include #include "util/u_format.h" #include "util/u_memory.h" +#include "util/u_math.h" #include "pipe/p_shader_tokens.h" #include "r600_pipe.h" #include "r600_sq.h" @@ -2288,7 +2288,7 @@ int r600_vertex_elements_build_fetch_shader(struct r600_pipe_context *rctx, stru if (R600_BIG_ENDIAN) { for (i = 0; i < ve->fs_size / 4; ++i) { - bytecode[i] = bswap_32(bc.bytecode[i]); + bytecode[i] = util_bswap32(bc.bytecode[i]); } } else { memcpy(bytecode, bc.bytecode, ve->fs_size); diff --git a/dist/Mesa/src/gallium/drivers/r600/r600_buffer.c b/dist/Mesa/src/gallium/drivers/r600/r600_buffer.c index 72f352df3..0303f7b73 100644 --- a/dist/Mesa/src/gallium/drivers/r600/r600_buffer.c +++ b/dist/Mesa/src/gallium/drivers/r600/r600_buffer.c @@ -24,8 +24,6 @@ * Jerome Glisse * Corbin Simpson */ -#include - #include #include #include @@ -274,7 +272,7 @@ void r600_upload_const_buffer(struct r600_pipe_context *rctx, struct r600_resour } for (i = 0; i < size / 4; ++i) { - tmpPtr[i] = bswap_32(((uint32_t *)ptr)[i]); + tmpPtr[i] = util_bswap32(((uint32_t *)ptr)[i]); } u_upload_data(rctx->vbuf_mgr->uploader, 0, size, tmpPtr, const_offset, diff --git a/dist/Mesa/src/gallium/drivers/r600/r600_shader.c b/dist/Mesa/src/gallium/drivers/r600/r600_shader.c index ad2bfa6ca..c2d1e9f84 100644 --- a/dist/Mesa/src/gallium/drivers/r600/r600_shader.c +++ b/dist/Mesa/src/gallium/drivers/r600/r600_shader.c @@ -26,6 +26,7 @@ #include "tgsi/tgsi_scan.h" #include "tgsi/tgsi_dump.h" #include "util/u_format.h" +#include "util/u_math.h" #include "r600_pipe.h" #include "r600_asm.h" #include "r600_sq.h" @@ -34,7 +35,6 @@ #include "r600d.h" #include #include -#include /* CAYMAN notes Why CAYMAN got loops for lots of instructions is explained here. @@ -89,7 +89,7 @@ static int r600_pipe_shader(struct pipe_context *ctx, struct r600_pipe_shader *s ptr = (uint32_t*)r600_bo_map(rctx->radeon, shader->bo, 0, NULL); if (R600_BIG_ENDIAN) { for (i = 0; i < rshader->bc.ndw; ++i) { - ptr[i] = bswap_32(rshader->bc.bytecode[i]); + ptr[i] = util_bswap32(rshader->bc.bytecode[i]); } } else { memcpy(ptr, rshader->bc.bytecode, rshader->bc.ndw * sizeof(*ptr));