From: Michel Dänzer Date: Sat, 14 Feb 2009 10:40:48 +0000 (+1000) Subject: r300: Fix R300_CMD_SCRATCH on big endian. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5f3ab230ea3e971737b733b0c0358c0a85061f5c;p=mesa.git r300: Fix R300_CMD_SCRATCH on big endian. --- diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_drm.h b/src/mesa/drivers/dri/radeon/radeon_cs_drm.h index 8f0b449e41f..984725a6c9d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_drm.h +++ b/src/mesa/drivers/dri/radeon/radeon_cs_drm.h @@ -33,6 +33,7 @@ #define RADEON_CS_H #include +#include #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 diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c index 0f73dec1e51..aa95d86cd48 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c @@ -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); }