[Mesa-stable] [PATCH 2/2] radeonsi/compute: Use the compiler's COMPUTE_PGM_RSRC* register values

Emil Velikov emil.l.velikov at gmail.com
Wed Nov 18 09:43:31 PST 2015


Hi Tom,

Please flip the order of the patches and drop the now patch 1/2 from
the stable queue.

On 16 November 2015 at 20:03, Tom Stellard <thomas.stellard at amd.com> wrote:
> The compiler has more information and is able to optimize the bits
> it sets in these registers.
>
> CC: <mesa-stable at lists.freedesktop.org>
> ---
>  src/gallium/drivers/radeonsi/si_compute.c | 37 ++++++-------------------------
>  src/gallium/drivers/radeonsi/si_shader.c  |  2 ++
>  2 files changed, 9 insertions(+), 30 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
> index 2d551dd..a461b2c 100644
> --- a/src/gallium/drivers/radeonsi/si_compute.c
> +++ b/src/gallium/drivers/radeonsi/si_compute.c
> @@ -34,11 +34,6 @@
>
>  #define MAX_GLOBAL_BUFFERS 20
>
> -/* XXX: Even though we don't pass the scratch buffer via user sgprs any more
> - * LLVM still expects that we specify 4 USER_SGPRS so it can remain compatible
> - * with older mesa. */
> -#define NUM_USER_SGPRS 4
> -
>  struct si_compute {
>         struct si_context *ctx;
>
> @@ -238,7 +233,6 @@ static void si_launch_grid(
>         uint64_t kernel_args_va;
>         uint64_t scratch_buffer_va = 0;
>         uint64_t shader_va;
> -       unsigned arg_user_sgpr_count = NUM_USER_SGPRS;
>         unsigned i;
>         struct si_shader *shader = &program->shader;
>         unsigned lds_blocks;
> @@ -366,19 +360,7 @@ static void si_launch_grid(
>         si_pm4_set_reg(pm4, R_00B830_COMPUTE_PGM_LO, shader_va >> 8);
>         si_pm4_set_reg(pm4, R_00B834_COMPUTE_PGM_HI, shader_va >> 40);
>
> -       si_pm4_set_reg(pm4, R_00B848_COMPUTE_PGM_RSRC1,
> -               /* We always use at least 3 VGPRS, these come from
> -                * TIDIG_COMP_CNT.
> -                * XXX: The compiler should account for this.
> -                */
> -               S_00B848_VGPRS((MAX2(3, shader->num_vgprs) - 1) / 4)
> -               /* We always use at least 4 + arg_user_sgpr_count.  The 4 extra
> -                * sgprs are from TGID_X_EN, TGID_Y_EN, TGID_Z_EN, TG_SIZE_EN
> -                * XXX: The compiler should account for this.
> -                */
> -               |  S_00B848_SGPRS(((MAX2(4 + arg_user_sgpr_count,
> -                                       shader->num_sgprs)) - 1) / 8)
> -               |  S_00B028_FLOAT_MODE(shader->float_mode))
> +       si_pm4_set_reg(pm4, R_00B848_COMPUTE_PGM_RSRC1, shader->rsrc1);
>                 ;
The above semicolon should be nuked as well, shouldn't it ?

Thanks
Emil


More information about the mesa-stable mailing list