Mesa (master): i965: fix subnr overflow in suboffset()

Iago Toral Quiroga itoral at kemper.freedesktop.org
Wed Oct 19 09:52:16 UTC 2016


Module: Mesa
Branch: master
Commit: 66d8bd3b7e577b7ae4d0b29186dce95d615e2c40
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=66d8bd3b7e577b7ae4d0b29186dce95d615e2c40

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Tue Sep 27 12:23:44 2016 +0200

i965: fix subnr overflow in suboffset()

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/mesa/drivers/dri/i965/brw_reg.h | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h
index 3b46d27..8907c9c 100644
--- a/src/mesa/drivers/dri/i965/brw_reg.h
+++ b/src/mesa/drivers/dri/i965/brw_reg.h
@@ -520,14 +520,6 @@ sechalf(struct brw_reg reg)
 }
 
 static inline struct brw_reg
-suboffset(struct brw_reg reg, unsigned delta)
-{
-   reg.subnr += delta * type_sz(reg.type);
-   return reg;
-}
-
-
-static inline struct brw_reg
 offset(struct brw_reg reg, unsigned delta)
 {
    reg.nr += delta;
@@ -544,6 +536,11 @@ byte_offset(struct brw_reg reg, unsigned bytes)
    return reg;
 }
 
+static inline struct brw_reg
+suboffset(struct brw_reg reg, unsigned delta)
+{
+   return byte_offset(reg, delta * type_sz(reg.type));
+}
 
 /** Construct unsigned word[16] register */
 static inline struct brw_reg




More information about the mesa-commit mailing list