|
@@ -32,8 +32,19 @@
|
|
|
#define _PIPE3(pipe, a, b, c) ((pipe) == PIPE_A ? (a) : \
|
|
|
(pipe) == PIPE_B ? (b) : (c))
|
|
|
|
|
|
-#define _MASKED_BIT_ENABLE(a) (((a) << 16) | (a))
|
|
|
-#define _MASKED_BIT_DISABLE(a) ((a) << 16)
|
|
|
+#define _MASKED_FIELD(mask, value) ({ \
|
|
|
+ if (__builtin_constant_p(mask)) \
|
|
|
+ BUILD_BUG_ON_MSG(((mask) & 0xffff0000), "Incorrect mask"); \
|
|
|
+ if (__builtin_constant_p(value)) \
|
|
|
+ BUILD_BUG_ON_MSG((value) & 0xffff0000, "Incorrect value"); \
|
|
|
+ if (__builtin_constant_p(mask) && __builtin_constant_p(value)) \
|
|
|
+ BUILD_BUG_ON_MSG((value) & ~(mask), \
|
|
|
+ "Incorrect value for mask"); \
|
|
|
+ (mask) << 16 | (value); })
|
|
|
+#define _MASKED_BIT_ENABLE(a) ({ typeof(a) _a = (a); _MASKED_FIELD(_a, _a); })
|
|
|
+#define _MASKED_BIT_DISABLE(a) (_MASKED_FIELD((a), 0))
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/* PCI config space */
|
|
|
|
|
@@ -1282,7 +1293,7 @@ enum punit_power_well {
|
|
|
#define GEN6_WIZ_HASHING_8x8 GEN6_WIZ_HASHING(0, 0)
|
|
|
#define GEN6_WIZ_HASHING_8x4 GEN6_WIZ_HASHING(0, 1)
|
|
|
#define GEN6_WIZ_HASHING_16x4 GEN6_WIZ_HASHING(1, 0)
|
|
|
-#define GEN6_WIZ_HASHING_MASK (GEN6_WIZ_HASHING(1, 1) << 16)
|
|
|
+#define GEN6_WIZ_HASHING_MASK GEN6_WIZ_HASHING(1, 1)
|
|
|
#define GEN6_TD_FOUR_ROW_DISPATCH_DISABLE (1 << 5)
|
|
|
|
|
|
#define GFX_MODE 0x02520
|