r300: Fix R300_CMD_SCRATCH on big endian.
authorMichel Dänzer <michel@daenzer.net>
Sat, 14 Feb 2009 10:40:48 +0000 (20:40 +1000)
committerDave Airlie <airlied@redhat.com>
Sat, 14 Feb 2009 10:40:48 +0000 (20:40 +1000)
src/mesa/drivers/dri/radeon/radeon_cs_drm.h
src/mesa/drivers/dri/radeon/radeon_cs_legacy.c

index 8f0b449e41f10ffed8dce03ffdadbf2d5ac15314..984725a6c9d3157074ec1ee9fa513ba0eff2cedc 100644 (file)
@@ -33,6 +33,7 @@
 #define RADEON_CS_H
 
 #include <stdint.h>
+#include <string.h>
 #include "drm.h"
 #include "radeon_drm.h"
 
@@ -194,4 +195,13 @@ static inline void radeon_cs_write_dword(struct radeon_cs *cs, uint32_t dword)
     }
 }
 
+static inline void radeon_cs_write_qword(struct radeon_cs *cs, uint64_t qword)
+{
+
+    memcpy(cs->packets + cs->cdw, &qword, sizeof(qword));
+    cs->cdw+=2;
+    if (cs->section) {
+        cs->section_cdw+=2;
+    }
+}
 #endif
index 0f73dec1e51101e3d928b0087cd157da007d9706..aa95d86cd48c0e82d91676d4eb45fa3aa2d3496a 100644 (file)
@@ -288,8 +288,7 @@ static int cs_emit(struct radeon_cs *cs)
       age.scratch.n_bufs = 1;
       age.scratch.flags = 0;
       radeon_cs_write_dword(cs, age.u);
-      radeon_cs_write_dword(cs, ull & 0xffffffff);
-      radeon_cs_write_dword(cs, ull >> 32);
+      radeon_cs_write_qword(cs, ull);
       radeon_cs_write_dword(cs, 0);
     }