r600c: fix setting negative values to bitfields

when setting negative integers to bitfields we could overwrite
other parts of it. So mask the value to be written correctly.
This is used quite often in the driver - hope it doesnt affect
performace or uncover behaviour relied before...

fixes strange effects when setting negative lodbias on evergreen
This commit is contained in:
Andre Maasikas 2010-09-14 18:56:39 +03:00
parent 79ab394cd2
commit b0bc026c12

View file

@ -38,7 +38,7 @@
#include "r700_chipoffset.h"
#define SETfield(x, val, shift, mask) ( (x) = ((x) & ~(mask)) | ((val) << (shift)) ) /* u32All */
#define SETfield(x, val, shift, mask) ( (x) = ((x) & ~(mask)) | (((val) << (shift)) & (mask)) )/* u32All */
#define CLEARfield(x, mask) ( (x) &= ~(mask) )
#define SETbit(x, bit) ( (x) |= (bit) )
#define CLEARbit(x, bit) ( (x) &= ~(bit) )