From: Alyssa Rosenzweig Date: Wed, 9 Jun 2021 17:09:44 +0000 (-0400) Subject: panfrost: Don't clobber indirect dispatch fields X-Git-Tag: upstream/21.2.3~2129 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77aff510907624e1972d77e5d4c60089813d961e;p=platform%2Fupstream%2Fmesa.git panfrost: Don't clobber indirect dispatch fields These should be kept as zero so they can be packed correctly. Fixes a number of KHR-GLES31 fails. Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_compute.c b/src/gallium/drivers/panfrost/pan_compute.c index 841548f..2c9cdf7 100644 --- a/src/gallium/drivers/panfrost/pan_compute.c +++ b/src/gallium/drivers/panfrost/pan_compute.c @@ -160,7 +160,7 @@ panfrost_launch_grid(struct pipe_context *pipe, num_wg[0], num_wg[1], num_wg[2], info->block[0], info->block[1], info->block[2], - false); + false, info->indirect != NULL); pan_section_pack(t.cpu, COMPUTE_JOB, PARAMETERS, cfg) { cfg.job_task_split = diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 831ba1d..33993cb 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -528,7 +528,7 @@ panfrost_direct_draw(struct panfrost_batch *batch, if (info->instance_count > 1) { panfrost_pack_work_groups_compute(&invocation, 1, vertex_count, info->instance_count, - 1, 1, 1, true); + 1, 1, 1, true, false); } else { pan_pack(&invocation, INVOCATION, cfg) { cfg.invocations = MALI_POSITIVE(vertex_count); diff --git a/src/panfrost/lib/pan_blitter.c b/src/panfrost/lib/pan_blitter.c index 3f5e3cd..61ffb50 100644 --- a/src/panfrost/lib/pan_blitter.c +++ b/src/panfrost/lib/pan_blitter.c @@ -1145,7 +1145,7 @@ pan_preload_emit_midgard_tiler_job(struct pan_pool *desc_pool, MIDGARD_TILER_JOB, INVOCATION); panfrost_pack_work_groups_compute(invoc, 1, 4, - 1, 1, 1, 1, true); + 1, 1, 1, 1, true, false); panfrost_add_job(desc_pool, scoreboard, MALI_JOB_TYPE_TILER, false, false, 0, 0, &job, true); @@ -1180,7 +1180,7 @@ pan_blit_emit_midgard_tiler_job(struct pan_pool *desc_pool, MIDGARD_TILER_JOB, INVOCATION); panfrost_pack_work_groups_compute(invoc, 1, 4, - 1, 1, 1, 1, true); + 1, 1, 1, 1, true, false); panfrost_add_job(desc_pool, scoreboard, MALI_JOB_TYPE_TILER, false, false, 0, 0, &job, false); @@ -1216,7 +1216,7 @@ pan_blit_emit_bifrost_tiler_job(struct pan_pool *desc_pool, BIFROST_TILER_JOB, INVOCATION); panfrost_pack_work_groups_compute(invoc, 1, 4, - 1, 1, 1, 1, true); + 1, 1, 1, 1, true, false); pan_section_pack(job.cpu, BIFROST_TILER_JOB, PADDING, cfg); pan_section_pack(job.cpu, BIFROST_TILER_JOB, TILER, cfg) { diff --git a/src/panfrost/lib/pan_encoder.h b/src/panfrost/lib/pan_encoder.h index 680808e..ecc09ca 100644 --- a/src/panfrost/lib/pan_encoder.h +++ b/src/panfrost/lib/pan_encoder.h @@ -66,7 +66,8 @@ panfrost_pack_work_groups_compute( unsigned size_x, unsigned size_y, unsigned size_z, - bool quirk_graphics); + bool quirk_graphics, + bool indirect_dispatch); /* Tiler structure size computation */ diff --git a/src/panfrost/lib/pan_indirect_dispatch.c b/src/panfrost/lib/pan_indirect_dispatch.c index 3bcc42a..82c8ed1 100644 --- a/src/panfrost/lib/pan_indirect_dispatch.c +++ b/src/panfrost/lib/pan_indirect_dispatch.c @@ -133,7 +133,7 @@ pan_indirect_dispatch_emit(struct pan_pool *pool, panfrost_pack_work_groups_compute(invocation, 1, 1, 1, 1, 1, 1, - false); + false, false); pan_section_pack(job.cpu, COMPUTE_JOB, PARAMETERS, cfg) { cfg.job_task_split = 2; diff --git a/src/panfrost/lib/pan_indirect_draw.c b/src/panfrost/lib/pan_indirect_draw.c index 8008764..05251a9 100644 --- a/src/panfrost/lib/pan_indirect_draw.c +++ b/src/panfrost/lib/pan_indirect_draw.c @@ -1245,7 +1245,7 @@ panfrost_emit_index_min_max_search(struct pan_pool *pool, pan_section_ptr(job.cpu, COMPUTE_JOB, INVOCATION); panfrost_pack_work_groups_compute(invocation, 1, 1, 1, MIN_MAX_JOBS, 1, 1, - false); + false, false); pan_section_pack(job.cpu, COMPUTE_JOB, PARAMETERS, cfg) { cfg.job_task_split = 7; @@ -1337,7 +1337,7 @@ panfrost_emit_indirect_draw(struct pan_pool *pool, pan_section_ptr(job.cpu, COMPUTE_JOB, INVOCATION); panfrost_pack_work_groups_compute(invocation, 1, 1, 1, 1, 1, 1, - false); + false, false); pan_section_pack(job.cpu, COMPUTE_JOB, PARAMETERS, cfg) { cfg.job_task_split = 2; diff --git a/src/panfrost/lib/pan_invocation.c b/src/panfrost/lib/pan_invocation.c index 6c0843e..02f7169 100644 --- a/src/panfrost/lib/pan_invocation.c +++ b/src/panfrost/lib/pan_invocation.c @@ -48,7 +48,8 @@ panfrost_pack_work_groups_compute( unsigned size_x, unsigned size_y, unsigned size_z, - bool quirk_graphics) + bool quirk_graphics, + bool indirect_dispatch) { uint32_t packed = 0; @@ -88,8 +89,12 @@ panfrost_pack_work_groups_compute( cfg.size_y_shift = shifts[1]; cfg.size_z_shift = shifts[2]; cfg.workgroups_x_shift = shifts[3]; - cfg.workgroups_y_shift = shifts[4]; - cfg.workgroups_z_shift = shifts[5]; + + if (!indirect_dispatch) { + /* Leave zero for the dispatch shader */ + cfg.workgroups_y_shift = shifts[4]; + cfg.workgroups_z_shift = shifts[5]; + } /* Quirk: for non-instanced graphics, the blob sets * workgroups_z_shift = 32. This doesn't appear to matter to