Mesa (staging/20.1): freedreno: Make the pack struct have a .qword for wide addresses.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 10 15:03:37 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: 3ff8b5b27513cb89d23bb89ef1839b00d3aceca3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3ff8b5b27513cb89d23bb89ef1839b00d3aceca3

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Sep  3 14:46:24 2020 -0700

freedreno: Make the pack struct have a .qword for wide addresses.

Storing a precomputed iova in reg packing wasn't possible because you'd
truncate to 32 bits.  Making it be .qword makes it possible.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6592>
(cherry picked from commit 3b3772d6e694da91ead40c144292f5a93b2aa42e)

---

 .pick_status.json                     |  2 +-
 src/freedreno/registers/gen_header.py | 13 ++++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index bc426f68359..bc060853e50 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -409,7 +409,7 @@
         "description": "freedreno: Make the pack struct have a .qword for wide addresses.",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/freedreno/registers/gen_header.py b/src/freedreno/registers/gen_header.py
index 7e3bcd4f7d8..33fcb344945 100644
--- a/src/freedreno/registers/gen_header.py
+++ b/src/freedreno/registers/gen_header.py
@@ -126,8 +126,11 @@ class Bitset(object):
 		if prefix == None:
 			prefix = self.name
 
+		value_name = "dword"
 		print("struct %s {" % prefix)
 		for f in self.fields:
+			if f.type == "waddress":
+				value_name = "qword"
 			if f.type in [ "address", "waddress" ]:
 				tab_to("    __bo_type", "bo;")
 				tab_to("    uint32_t", "bo_offset;")
@@ -137,8 +140,12 @@ class Bitset(object):
 			type, val = f.ctype("var")
 
 			tab_to("    %s" % type, "%s;" % name)
-		tab_to("    uint32_t", "unknown;")
-		tab_to("    uint32_t", "dword;")
+		if value_name == "qword":
+			tab_to("    uint64_t", "unknown;")
+			tab_to("    uint64_t", "qword;")
+		else:
+			tab_to("    uint32_t", "unknown;")
+			tab_to("    uint32_t", "dword;")
 		print("};\n")
 
 		address = None;
@@ -176,7 +183,7 @@ class Bitset(object):
 			else:
 				type, val = f.ctype("fields.%s" % field_name(prefix, f.name))
 				print("            (%-40s << %2d) |" % (val, f.low))
-		print("            fields.unknown | fields.dword,")
+		print("            fields.unknown | fields.%s," % (value_name,))
 
 		if address:
 			print("        .is_address = true,")



More information about the mesa-commit mailing list