Mesa (master): freedreno: Fix OUT_REG() on address regs without a .bo supplied.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 23 23:01:04 UTC 2020


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Jan 17 14:28:13 2020 -0800

freedreno: Fix OUT_REG() on address regs without a .bo supplied.

Sometimes you want to zero out an address by supplying a NULL BO, but
without this we would end up only emitting one dword.  Increases size of
fd6_gmem.o by .8%, though it's not clear to me why (no obvious terrible
codegen happening)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3455>

---

 src/freedreno/registers/gen_header.py         | 1 +
 src/gallium/drivers/freedreno/a6xx/fd6_pack.h | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/src/freedreno/registers/gen_header.py b/src/freedreno/registers/gen_header.py
index f11724d707a..887656fd5d8 100644
--- a/src/freedreno/registers/gen_header.py
+++ b/src/freedreno/registers/gen_header.py
@@ -179,6 +179,7 @@ class Bitset(object):
 		print("            fields.unknown | fields.dword,")
 
 		if address:
+			print("        .is_address = true,")
 			print("        .bo = fields.bo,")
 			if f.type == "waddress":
 				print("        .bo_write = true,")
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_pack.h b/src/gallium/drivers/freedreno/a6xx/fd6_pack.h
index f5f8e2ca5f7..b3b9bf9244d 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_pack.h
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_pack.h
@@ -30,6 +30,7 @@ struct fd_reg_pair {
 	uint32_t reg;
 	uint64_t value;
 	struct fd_bo *bo;
+	bool is_address;
 	bool bo_write;
 	uint32_t bo_offset;
 	uint32_t bo_shift;
@@ -68,6 +69,8 @@ struct fd_reg_pair {
 				fd_ringbuffer_reloc(ring, &reloc);					\
 			} else {												\
 				*p++ = regs[i].value;								\
+				if (regs[i].is_address)								\
+					*p++ = regs[i].value >> 32;						\
 			}														\
 		}															\
 	} while (0)



More information about the mesa-commit mailing list