Module: Mesa
Branch: main
Commit: c1d6d745cfeebba140d3c3a88f8a9cf7fa7fc503
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c1d6d745cfeebba140d3c3a88f8a9cf7fa7fc503

Author: Yonggang Luo <luoyongg...@gmail.com>
Date:   Thu Jan  4 18:40:05 2024 +0800

asahi,panfrost: Use IS_POT_NONZERO to replace util_is_power_of_two_nonzero for 
different size

This member's size are not fixed, so use IS_POT_NONZERO over it

Signed-off-by: Yonggang Luo <luoyongg...@gmail.com>
Reviewed-by: Marek Olšák <marek.ol...@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26909>

---

 src/asahi/lib/gen_pack.py           | 2 +-
 src/panfrost/lib/genxml/gen_pack.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/asahi/lib/gen_pack.py b/src/asahi/lib/gen_pack.py
index 2a39e7bd96e..98216453590 100644
--- a/src/asahi/lib/gen_pack.py
+++ b/src/asahi/lib/gen_pack.py
@@ -424,7 +424,7 @@ class Group(object):
             elif field.modifier[0] == "minus":
                 print("   assert(values->{} >= {});".format(field.name, 
field.modifier[1]))
             elif field.modifier[0] == "log2":
-                print("   
assert(util_is_power_of_two_nonzero(values->{}));".format(field.name))
+                print("   
assert(IS_POT_NONZERO(values->{}));".format(field.name))
 
         for index in range(math.ceil(self.length / 4)):
             # Handle MBZ words
diff --git a/src/panfrost/lib/genxml/gen_pack.py 
b/src/panfrost/lib/genxml/gen_pack.py
index 8d1df522ca0..8a3e951ac24 100644
--- a/src/panfrost/lib/genxml/gen_pack.py
+++ b/src/panfrost/lib/genxml/gen_pack.py
@@ -463,7 +463,7 @@ class Group(object):
             elif field.modifier[0] == "minus":
                 print("   assert(values->{} >= {});".format(field.name, 
field.modifier[1]))
             elif field.modifier[0] == "log2":
-                print("   
assert(util_is_power_of_two_nonzero(values->{}));".format(field.name))
+                print("   
assert(IS_POT_NONZERO(values->{}));".format(field.name))
 
         for index in range(self.length // 4):
             # Handle MBZ words

Reply via email to