Mesa (master): r600/sb: introduce special register values for lds support.

Dave Airlie airlied at kemper.freedesktop.org
Thu Jan 18 03:39:44 UTC 2018


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Jan 10 03:52:50 2018 +0000

r600/sb: introduce special register values for lds support.

For LDS read/write ordering we use the LDS_RW value, reads
will wait on previous writes.
For LDS read/read from LDS queue ordering we use the LDS_OQ
values, we define two for now, though initially we'll just
support OQA.

Also add the check for the lds oq values

Acked-By: Roland Scheidegger <sroland at vmware.com>
Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/gallium/drivers/r600/sb/sb_bc.h         |  4 ++++
 src/gallium/drivers/r600/sb/sb_ir.h         | 27 ++++++++++++++++++++++++++-
 src/gallium/drivers/r600/sb/sb_valtable.cpp |  3 +++
 3 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/r600/sb/sb_bc.h b/src/gallium/drivers/r600/sb/sb_bc.h
index fc3fa5082d..3a3bae9d44 100644
--- a/src/gallium/drivers/r600/sb/sb_bc.h
+++ b/src/gallium/drivers/r600/sb/sb_bc.h
@@ -722,6 +722,10 @@ public:
 		return ((sel >= 128 && sel < 192) || (sel >= 256 && sel < 320));
 	}
 
+	bool is_lds_oq(unsigned sel) {
+		return (sel >= 0xdb && sel <= 0xde);
+	}
+
 	const char * get_hw_class_name();
 	const char * get_hw_chip_name();
 
diff --git a/src/gallium/drivers/r600/sb/sb_ir.h b/src/gallium/drivers/r600/sb/sb_ir.h
index 2390babfcf..bee947504e 100644
--- a/src/gallium/drivers/r600/sb/sb_ir.h
+++ b/src/gallium/drivers/r600/sb/sb_ir.h
@@ -42,7 +42,10 @@ enum special_regs {
 	SV_EXEC_MASK,
 	SV_AR_INDEX,
 	SV_VALID_MASK,
-	SV_GEOMETRY_EMIT
+	SV_GEOMETRY_EMIT,
+	SV_LDS_RW,
+	SV_LDS_OQA,
+	SV_LDS_OQB,
 };
 
 class node;
@@ -495,6 +498,12 @@ public:
 	bool is_geometry_emit() {
 		return is_special_reg() && select == sel_chan(SV_GEOMETRY_EMIT, 0);
 	}
+	bool is_lds_access() {
+		return is_special_reg() && select == sel_chan(SV_LDS_RW, 0);
+	}
+	bool is_lds_oq() {
+		return is_special_reg() && (select == sel_chan(SV_LDS_OQA, 0) || select == sel_chan(SV_LDS_OQB, 0));
+	}
 
 	node* any_def() {
 		assert(!(def && adef));
@@ -833,6 +842,22 @@ public:
 		return vec_uses_ar(dst) || vec_uses_ar(src);
 	}
 
+	bool vec_uses_lds_oq(vvec &vv) {
+		for (vvec::iterator I = vv.begin(), E = vv.end(); I != E; ++I) {
+			value *v = *I;
+			if (v && v->is_lds_oq())
+				return true;
+		}
+		return false;
+	}
+
+	bool consumes_lds_oq() {
+		return vec_uses_lds_oq(src);
+	}
+
+	bool produces_lds_oq() {
+		return vec_uses_lds_oq(dst);
+	}
 
 	region_node* get_parent_region();
 
diff --git a/src/gallium/drivers/r600/sb/sb_valtable.cpp b/src/gallium/drivers/r600/sb/sb_valtable.cpp
index a85537c2ad..41cfbf0946 100644
--- a/src/gallium/drivers/r600/sb/sb_valtable.cpp
+++ b/src/gallium/drivers/r600/sb/sb_valtable.cpp
@@ -56,6 +56,9 @@ sb_ostream& operator << (sb_ostream &o, value &v) {
 			case SV_EXEC_MASK: o << "EM"; break;
 			case SV_VALID_MASK: o << "VM"; break;
 			case SV_GEOMETRY_EMIT: o << "GEOMETRY_EMIT"; break;
+			case SV_LDS_RW: o << "LDS_RW"; break;
+			case SV_LDS_OQA: o << "LDS_OQA"; break;
+			case SV_LDS_OQB: o << "LDS_OQB"; break;
 			default: o << "???specialreg"; break;
 		}
 		break;




More information about the mesa-commit mailing list