Mesa (master): freedreno: Cleanup event names

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 2 16:41:36 UTC 2020


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

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Thu Mar  5 17:10:47 2020 +0100

freedreno: Cleanup event names

It turns out that every *_TS event, i.e. every event which requires a
seqno pointer, also allows generating an interrupt in the kernel, at
least since a3xx. And furthermore these interrupts are named by the kgsl
kernel driver and already in envytools. Therefore it's possible to map
out what the *_TS events are with 100% certainty, given access to the
hardware, by sending a CP_EVENT_WRITE with bit 31 set, unmasking all
interrupts in the kernel, and logging which ones get hit. I've done this
for a6xx, and I've also looked at the a5xx firmware, and the list of TS
interrupts is the same as a6xx, so I have a pretty good idea of what the
a5xx events are. I also fixed a few related things along the way:

- VIZQUERY_END overlaps with WT_DONE_TS, but VIZQUERY_START was also a
mess, with neither VIZQUERY_START nor HLSQ_FLUSH using variants. I added
what seems like reasonable variants, based on the existing comment
and the fact that HLSQ_FLUSH is only used in Mesa with a3xx and a4xx.
- CACHE_FLUSH_AND_INVALIDATE seems to come straight from R600, and I
have no idea if it's actually valid with a2xx, but given that RB_DONE_TS
exists in the interrupt mask since a3xx, I guessed that RB_DONE_TS
hasn't changed position since then and put it down as a3xx+ and limited
CACHE_FLUSH_AND_INVALIDATE to a2xx. Someone with the relevant hardware
should be able to confirm.

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

---

 src/freedreno/registers/adreno_pm4.xml | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/freedreno/registers/adreno_pm4.xml b/src/freedreno/registers/adreno_pm4.xml
index a2b69c57a12..c5d83d06550 100644
--- a/src/freedreno/registers/adreno_pm4.xml
+++ b/src/freedreno/registers/adreno_pm4.xml
@@ -11,9 +11,9 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">
 	<value name="CACHE_FLUSH_TS" value="4"/>
 	<value name="CONTEXT_DONE" value="5"/>
 	<value name="CACHE_FLUSH" value="6"/>
-	<value name="HLSQ_FLUSH" value="7"/> <!-- on a3xx -->
-	<value name="VIZQUERY_START" value="7"/> <!-- on a2xx (??) -->
-	<value name="VIZQUERY_END" value="8"/>
+	<value name="VIZQUERY_START" value="7" variants="A2XX"/>
+	<value name="HLSQ_FLUSH" value="7" variants="A3XX,A4XX"/>
+	<value name="VIZQUERY_END" value="8" variants="A2XX"/>
 	<value name="SC_WAIT_WC" value="9"/>
 	<value name="WRITE_PRIMITIVE_COUNTS" value="9" variants="A6XX"/>
 	<value name="START_PRIMITIVE_CTRS" value="11" variants="A6XX"/>
@@ -24,13 +24,15 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">
 	<value name="STAT_EVENT" value="16"/>
 	<value name="CACHE_FLUSH_AND_INV_TS_EVENT" value="20" variants="A2XX,A3XX,A4XX"/>
 	<value name="ZPASS_DONE" value="21"/>
-	<value name="CACHE_FLUSH_AND_INV_EVENT" value="22"/>
+	<value name="CACHE_FLUSH_AND_INV_EVENT" value="22" variants="A2XX"/>
+	<value name="RB_DONE_TS" value="22" variants="A3XX-"/>
 	<value name="PERFCOUNTER_START" value="23" variants="A2XX,A3XX,A4XX"/>
 	<value name="PERFCOUNTER_STOP" value="24" variants="A2XX,A3XX,A4XX"/>
 	<value name="VS_FETCH_DONE" value="27"/>
 	<value name="FACENESS_FLUSH" value="28" variants="A2XX,A3XX,A4XX"/>
 
 	<!-- a5xx events -->
+	<value name="WT_DONE_TS" value="8" variants="A5XX,A6XX"/>
 	<value name="FLUSH_SO_0" value="17" variants="A5XX,A6XX"/>
 	<value name="FLUSH_SO_1" value="18" variants="A5XX,A6XX"/>
 	<value name="FLUSH_SO_2" value="19" variants="A5XX,A6XX"/>



More information about the mesa-commit mailing list