freedreno/a6xx, turnip: Set CONSTANTRAMMODE correctly
This should fix hangs when using more than 256 constants on a7xx.
Fixes: 5879eaac18
("ir3: Increase compute const size on a7xx")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34746>
(cherry picked from commit 80bcbc0e924f7e021bcca155fa12501a2d6fb467)
This commit is contained in:

committed by
Eric Engestrom

parent
2a06a20a4a
commit
385a56642b
@@ -64,7 +64,7 @@
|
||||
"description": "freedreno/a6xx, turnip: Set CONSTANTRAMMODE correctly",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "5879eaac185ed1c167fd01aff9b91c7cbe43ab0a",
|
||||
"notes": null
|
||||
|
@@ -180,14 +180,18 @@ cs_program_emit(struct fd_ringbuffer *ring, struct kernel *kernel)
|
||||
}
|
||||
|
||||
uint32_t shared_size = MAX2(((int)v->shared_size - 1) / 1024, 1);
|
||||
enum a6xx_const_ram_mode mode =
|
||||
v->constlen > 256 ? CONSTLEN_512 :
|
||||
(v->constlen > 192 ? CONSTLEN_256 :
|
||||
(v->constlen > 128 ? CONSTLEN_192 : CONSTLEN_128));
|
||||
OUT_PKT4(ring, REG_A6XX_SP_CS_CTRL_REG1, 1);
|
||||
OUT_RING(ring, A6XX_SP_CS_CTRL_REG1_SHARED_SIZE(shared_size) |
|
||||
A6XX_SP_CS_CTRL_REG1_CONSTANTRAMMODE(CONSTLEN_256));
|
||||
A6XX_SP_CS_CTRL_REG1_CONSTANTRAMMODE(mode));
|
||||
|
||||
if (CHIP == A6XX && a6xx_backend->info->a6xx.has_lpac) {
|
||||
OUT_PKT4(ring, REG_A6XX_HLSQ_CS_CTRL_REG1, 1);
|
||||
OUT_RING(ring, A6XX_HLSQ_CS_CTRL_REG1_SHARED_SIZE(1) |
|
||||
A6XX_HLSQ_CS_CTRL_REG1_CONSTANTRAMMODE(CONSTLEN_256));
|
||||
A6XX_HLSQ_CS_CTRL_REG1_CONSTANTRAMMODE(mode));
|
||||
}
|
||||
|
||||
uint32_t local_invocation_id, work_group_id;
|
||||
|
@@ -1530,14 +1530,18 @@ tu6_emit_cs_config(struct tu_cs *cs,
|
||||
tu6_emit_xs(cs, MESA_SHADER_COMPUTE, v, pvtmem, binary_iova);
|
||||
|
||||
uint32_t shared_size = MAX2(((int)v->shared_size - 1) / 1024, 1);
|
||||
enum a6xx_const_ram_mode mode =
|
||||
v->constlen > 256 ? CONSTLEN_512 :
|
||||
(v->constlen > 192 ? CONSTLEN_256 :
|
||||
(v->constlen > 128 ? CONSTLEN_192 : CONSTLEN_128));
|
||||
tu_cs_emit_pkt4(cs, REG_A6XX_SP_CS_CTRL_REG1, 1);
|
||||
tu_cs_emit(cs, A6XX_SP_CS_CTRL_REG1_SHARED_SIZE(shared_size) |
|
||||
A6XX_SP_CS_CTRL_REG1_CONSTANTRAMMODE(CONSTLEN_256));
|
||||
A6XX_SP_CS_CTRL_REG1_CONSTANTRAMMODE(mode));
|
||||
|
||||
if (CHIP == A6XX && cs->device->physical_device->info->a6xx.has_lpac) {
|
||||
tu_cs_emit_pkt4(cs, REG_A6XX_HLSQ_CS_CTRL_REG1, 1);
|
||||
tu_cs_emit(cs, A6XX_HLSQ_CS_CTRL_REG1_SHARED_SIZE(shared_size) |
|
||||
A6XX_HLSQ_CS_CTRL_REG1_CONSTANTRAMMODE(CONSTLEN_256));
|
||||
A6XX_HLSQ_CS_CTRL_REG1_CONSTANTRAMMODE(mode));
|
||||
}
|
||||
|
||||
uint32_t local_invocation_id =
|
||||
|
@@ -220,14 +220,18 @@ fd6_launch_grid(struct fd_context *ctx, const struct pipe_grid_info *info) in_dt
|
||||
|
||||
uint32_t shared_size =
|
||||
MAX2(((int)(cs->v->cs.req_local_mem + info->variable_shared_mem) - 1) / 1024, 1);
|
||||
enum a6xx_const_ram_mode mode =
|
||||
cs->v->constlen > 256 ? CONSTLEN_512 :
|
||||
(cs->v->constlen > 192 ? CONSTLEN_256 :
|
||||
(cs->v->constlen > 128 ? CONSTLEN_192 : CONSTLEN_128));
|
||||
OUT_PKT4(ring, REG_A6XX_SP_CS_CTRL_REG1, 1);
|
||||
OUT_RING(ring, A6XX_SP_CS_CTRL_REG1_SHARED_SIZE(shared_size) |
|
||||
A6XX_SP_CS_CTRL_REG1_CONSTANTRAMMODE(CONSTLEN_256));
|
||||
A6XX_SP_CS_CTRL_REG1_CONSTANTRAMMODE(mode));
|
||||
|
||||
if (CHIP == A6XX && ctx->screen->info->a6xx.has_lpac) {
|
||||
OUT_PKT4(ring, REG_A6XX_HLSQ_CS_CTRL_REG1, 1);
|
||||
OUT_RING(ring, A6XX_HLSQ_CS_CTRL_REG1_SHARED_SIZE(shared_size) |
|
||||
A6XX_HLSQ_CS_CTRL_REG1_CONSTANTRAMMODE(CONSTLEN_256));
|
||||
A6XX_HLSQ_CS_CTRL_REG1_CONSTANTRAMMODE(mode));
|
||||
}
|
||||
|
||||
const unsigned *local_size =
|
||||
|
Reference in New Issue
Block a user