summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2013-06-17 23:21:24 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2013-06-17 23:21:24 +0000
commit4b74327153a2a17b22f281f84700a59dd78417ba (patch)
tree5252bfedc0791565e5820f61a383948046706b92 /dist
parentf232ddb8880b9776320a2e9ac2c6175930fd5ae2 (diff)
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@
Diffstat (limited to 'dist')
-rw-r--r--dist/Mesa/src/gallium/drivers/r600/r600_asm.c4
-rw-r--r--dist/Mesa/src/gallium/drivers/r600/r600_buffer.c4
-rw-r--r--dist/Mesa/src/gallium/drivers/r600/r600_shader.c4
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 <stdio.h>
#include <errno.h>
-#include <byteswap.h>
#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 <MostAwesomeDude@gmail.com>
*/
-#include <byteswap.h>
-
#include <pipe/p_screen.h>
#include <util/u_format.h>
#include <util/u_math.h>
@@ -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 <stdio.h>
#include <errno.h>
-#include <byteswap.h>
/* 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));