diff options
author | Chia-I Wu <[email protected]> | 2014-09-12 10:08:31 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2014-09-12 16:58:29 +0800 |
commit | ea5de3e0bd82c52130633b1f01b5e0ed226b3b76 (patch) | |
tree | c9c16226327f8d17ac7f188f5dbacd99dce8f9da /src/gallium/drivers/ilo/genhw/genhw.h | |
parent | e8f4dd70ab4d2b93523b20a638ce2f226881555e (diff) |
ilo: add GEN_EXTRACT() and GEN_SHIFT32()
They replace READ() and SET_FIELD() that we have been using.
Diffstat (limited to 'src/gallium/drivers/ilo/genhw/genhw.h')
-rw-r--r-- | src/gallium/drivers/ilo/genhw/genhw.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/ilo/genhw/genhw.h b/src/gallium/drivers/ilo/genhw/genhw.h index d341ede8d15..126a8b5d3a9 100644 --- a/src/gallium/drivers/ilo/genhw/genhw.h +++ b/src/gallium/drivers/ilo/genhw/genhw.h @@ -53,6 +53,18 @@ #define GEN7_RENDER_CMD(subtype, op) GEN_RENDER_CMD(subtype, GEN7, op) #define GEN75_RENDER_CMD(subtype, op) GEN_RENDER_CMD(subtype, GEN75, op) +#define GEN_EXTRACT(bits, field) (((bits) & field ## __MASK) >> field ## __SHIFT) +#define GEN_SHIFT32(bits, field) gen_shift32(bits, field ## __MASK, field ## __SHIFT) + +static inline uint32_t +gen_shift32(uint32_t bits, uint32_t mask, int shift) +{ + bits <<= shift; + + assert((bits & mask) == bits); + return bits & mask; +} + static inline bool gen_is_snb(int devid) { |