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@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15714>
diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index 9da564a..a2690f2 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -484,16 +484,16 @@
/* 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 @@
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 @@
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;