From a90345d4c80ea5b7f78dd4e2f03513069751e731 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 9 Jun 2021 12:00:20 -0400 Subject: [PATCH] pan/indirect_dispatch: Simplify empty command case Job type is alone with bitsize in the bottom byte of the addressed worse, so if we use an 8-bit store we avoid the RMW complexity. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/lib/pan_indirect_dispatch.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/panfrost/lib/pan_indirect_dispatch.c b/src/panfrost/lib/pan_indirect_dispatch.c index 3663b823698..49729af1827 100644 --- a/src/panfrost/lib/pan_indirect_dispatch.c +++ b/src/panfrost/lib/pan_indirect_dispatch.c @@ -178,11 +178,9 @@ pan_indirect_dispatch_init(struct panfrost_device *dev) nir_push_if(&b, nir_ieq(&b, num_wg_flat, zero)); { - nir_ssa_def *job_type_ptr = nir_iadd(&b, job_hdr_ptr, nir_imm_int64(&b, 4 * 4)); - nir_ssa_def *w4 = nir_load_global(&b, job_type_ptr, 4, 1, 32); - w4 = nir_iand_imm(&b, w4, ~0xfe); - w4 = nir_ior(&b, w4, nir_imm_int(&b, MALI_JOB_TYPE_NULL << 1)); - nir_store_global(&b, job_type_ptr, 4, w4, 1); + nir_ssa_def *type_ptr = nir_iadd(&b, job_hdr_ptr, nir_imm_int64(&b, 4 * 4)); + nir_ssa_def *ntype = nir_imm_intN_t(&b, (MALI_JOB_TYPE_NULL << 1) | 1, 8); + nir_store_global(&b, type_ptr, 1, ntype, 1); } nir_push_else(&b, NULL); {