Mesa (main): r600: Don't limit scheduling of PARAM_SRC values

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 12 12:16:40 UTC 2022


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

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Fri Dec 10 22:44:50 2021 +0100

r600: Don't limit scheduling of PARAM_SRC values

ALU_SRC_PARAM_BASE is an inline constant that defines the
address for pulling data from LDS memory for interpolation
and not a value from the kcache, so there is no need to
take these values into account when allocating kcache
load slots.

v2: Fix the constant range check to not exclude the translated
    ranges for kcache banks 2 and 3.
v3: limit range check to only include kcache values and and
    rename relevant function (Emma).

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Acked-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15714>

---

 src/gallium/drivers/r600/r600_asm.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index 9da564a184b..a2690f23015 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -484,16 +484,16 @@ static int is_gpr(unsigned sel)
 /* CB constants start at 512, and get translated to a kcache index when ALU
  * clauses are constructed. Note that we handle kcache constants the same way
  * as (the now gone) cfile constants, is that really required? */
-static int is_cfile(unsigned sel)
+static int is_kcache(unsigned sel)
 {
-	return (sel > 255 && sel < 512) ||
-		(sel > 511 && sel < 4607) || /* Kcache before translation. */
-		(sel > 127 && sel < 192); /* Kcache after translation. */
+   return (sel > 511 && sel < 4607) || /* Kcache before translation. */
+         (sel > 127 && sel < 192) || /* Kcache 0 & 1 after translation. */
+         (sel > 256  && sel < 320);  /* Kcache 2 & 3 after translation (EG). */
 }
 
 static int is_const(int sel)
 {
-	return is_cfile(sel) ||
+   return is_kcache(sel) ||
 		(sel >= V_SQ_ALU_SRC_0 &&
 		sel <= V_SQ_ALU_SRC_LITERAL);
 }
@@ -518,7 +518,7 @@ static int check_vector(const struct r600_bytecode *bc, const struct r600_byteco
 				if (r)
 					return r;
 			}
-		} else if (is_cfile(sel)) {
+      } else if (is_kcache(sel)) {
 			r = reserve_cfile(bc, bs, (alu->src[src].kc_bank<<16) + sel, elem);
 			if (r)
 				return r;
@@ -545,7 +545,7 @@ static int check_scalar(const struct r600_bytecode *bc, const struct r600_byteco
 			else
 				const_count++;
 		}
-		if (is_cfile(sel)) {
+      if (is_kcache(sel)) {
 			r = reserve_cfile(bc, bs, (alu->src[src].kc_bank<<16) + sel, elem);
 			if (r)
 				return r;



More information about the mesa-commit mailing list