summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2007-10-10 15:27:42 -0700
committerIan Romanick <idr@us.ibm.com>2007-10-10 15:27:42 -0700
commit588dc4265fffec9e569a176e28476a27183d0cf5 (patch)
treeec7701093efcc43fca894090268fce0ba80151db
parent07e22f46f367b8b673c1e37e1487ebde16a61bc3 (diff)
Fix command list submission on big-endian.
-rw-r--r--src/xg47_cmdlist.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/xg47_cmdlist.c b/src/xg47_cmdlist.c
index e43651a..a3d9cc7 100644
--- a/src/xg47_cmdlist.c
+++ b/src/xg47_cmdlist.c
@@ -31,6 +31,7 @@
#include "xf86.h"
#include "xgi.h"
+#include "xgi_regs.h"
#include "xg47_regs.h"
#include "xgi_driver.h"
#include "xg47_cmdlist.h"
@@ -240,8 +241,12 @@ int xg47_BeginCmdList(struct xg47_CmdList *pCmdList, unsigned int req_size)
/* Prepare next begin */
- memcpy(pCmdList->current.end, s_emptyBegin, sizeof(s_emptyBegin));
- pCmdList->current.end += AGPCMDLIST_BEGIN_SIZE;
+ pCmdList->current.end[0] = BE_SWAP32(s_emptyBegin[0]);
+ pCmdList->current.end[1] = BE_SWAP32(s_emptyBegin[1]);
+ pCmdList->current.end[2] = BE_SWAP32(s_emptyBegin[2]);
+ pCmdList->current.end[3] = BE_SWAP32(s_emptyBegin[3]);
+ pCmdList->current.end += 4;
+
pCmdList->current.data_count = AGPCMDLIST_BEGIN_SIZE;
pCmdList->current.type = BTYPE_2D;
pCmdList->_bunch[0] = 0x7f000000;
@@ -269,10 +274,10 @@ void emit_bunch(struct xg47_CmdList *pCmdList)
/* Copy the commands from _bunch to the command buffer and advance the
* command buffer write pointer.
*/
- pCmdList->current.end[0] = pCmdList->_bunch[0];
- pCmdList->current.end[1] = pCmdList->_bunch[1];
- pCmdList->current.end[2] = pCmdList->_bunch[2];
- pCmdList->current.end[3] = pCmdList->_bunch[3];
+ pCmdList->current.end[0] = BE_SWAP32(pCmdList->_bunch[0]);
+ pCmdList->current.end[1] = BE_SWAP32(pCmdList->_bunch[1]);
+ pCmdList->current.end[2] = BE_SWAP32(pCmdList->_bunch[2]);
+ pCmdList->current.end[3] = BE_SWAP32(pCmdList->_bunch[3]);
pCmdList->current.end += 4;
/* Reset _bunch.