pan/midgard: Fix mir_round_bytemask_down for !32b
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 5 Nov 2019 03:21:47 +0000 (22:21 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 15 Nov 2019 20:08:46 +0000 (20:08 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/mir.c

index 609cd5c1db424a9a97fa00d85223e2c5af9f004c..7c7149bd547c695b433694ab8696d1d2a907578d 100644 (file)
@@ -376,10 +376,10 @@ mir_round_bytemask_down(uint16_t mask, midgard_reg_mode mode)
 
         for (unsigned c = 0; c < channels; ++c) {
                 /* Get bytes in component */
-                unsigned submask = (mask >> c * channels) & maxmask;
+                unsigned submask = (mask >> (c * bytes)) & maxmask;
 
                 if (submask != maxmask)
-                        mask &= ~(maxmask << (c * channels));
+                        mask &= ~(maxmask << (c * bytes));
         }
 
         return mask;