<div dir="ltr"><div>Yes, we can.</div><div><br></div><div>Marek<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 26, 2019 at 5:30 PM Timothy Arceri <<a href="mailto:tarceri@itsqueeze.com">tarceri@itsqueeze.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Guys,<br>
<br>
Can we get this one into the next 18.3 release. It fixes a hang with <br>
Counter Strike on start-up. I'm a little concerned this just works <br>
around the problem but the patch seems safe for stable.<br>
<br>
Thanks,<br>
Tim<br>
<br>
On 12/1/19 10:53 am, Marek Olšák wrote:<br>
> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
> <br>
> same as all other shaders<br>
> ---<br>
>   src/gallium/drivers/radeonsi/si_compute_blit.c | 14 ++++++++++++++<br>
>   src/gallium/drivers/radeonsi/si_pipe.c         |  8 --------<br>
>   2 files changed, 14 insertions(+), 8 deletions(-)<br>
> <br>
> diff --git a/src/gallium/drivers/radeonsi/si_compute_blit.c b/src/gallium/drivers/radeonsi/si_compute_blit.c<br>
> index 11da04bed85..dfa77a98804 100644<br>
> --- a/src/gallium/drivers/radeonsi/si_compute_blit.c<br>
> +++ b/src/gallium/drivers/radeonsi/si_compute_blit.c<br>
> @@ -104,36 +104,50 @@ static void si_compute_do_clear_or_copy(struct si_context *sctx,<br>
>       info.block[2] = 1;<br>
>       info.grid[0] = DIV_ROUND_UP(num_dwords, dwords_per_wave);<br>
>       info.grid[1] = 1;<br>
>       info.grid[2] = 1;<br>
>   <br>
>       struct pipe_shader_buffer sb[2] = {};<br>
>       sb[0].buffer = dst;<br>
>       sb[0].buffer_offset = dst_offset;<br>
>       sb[0].buffer_size = size;<br>
>   <br>
> +     bool shader_dst_stream_policy = SI_COMPUTE_DST_CACHE_POLICY != L2_LRU;<br>
> +<br>
>       if (src) {<br>
>               sb[1].buffer = src;<br>
>               sb[1].buffer_offset = src_offset;<br>
>               sb[1].buffer_size = size;<br>
>   <br>
>               ctx->set_shader_buffers(ctx, PIPE_SHADER_COMPUTE, 0, 2, sb);<br>
> +<br>
> +             if (!sctx->cs_copy_buffer) {<br>
> +                     sctx->cs_copy_buffer = si_create_dma_compute_shader(&sctx->b,<br>
> +                                                          SI_COMPUTE_COPY_DW_PER_THREAD,<br>
> +                                                          shader_dst_stream_policy, true);<br>
> +             }<br>
>               ctx->bind_compute_state(ctx, sctx->cs_copy_buffer);<br>
>       } else {<br>
>               assert(clear_value_size >= 4 &&<br>
>                      clear_value_size <= 16 &&<br>
>                      util_is_power_of_two_or_zero(clear_value_size));<br>
>   <br>
>               for (unsigned i = 0; i < 4; i++)<br>
>                       sctx->cs_user_data[i] = clear_value[i % (clear_value_size / 4)];<br>
>   <br>
>               ctx->set_shader_buffers(ctx, PIPE_SHADER_COMPUTE, 0, 1, sb);<br>
> +<br>
> +             if (!sctx->cs_clear_buffer) {<br>
> +                     sctx->cs_clear_buffer = si_create_dma_compute_shader(&sctx->b,<br>
> +                                                          SI_COMPUTE_CLEAR_DW_PER_THREAD,<br>
> +                                                          shader_dst_stream_policy, false);<br>
> +             }<br>
>               ctx->bind_compute_state(ctx, sctx->cs_clear_buffer);<br>
>       }<br>
>   <br>
>       ctx->launch_grid(ctx, &info);<br>
>   <br>
>       enum si_cache_policy cache_policy = get_cache_policy(sctx, coher, size);<br>
>       sctx->flags |= SI_CONTEXT_CS_PARTIAL_FLUSH |<br>
>                      (cache_policy == L2_BYPASS ? SI_CONTEXT_WRITEBACK_GLOBAL_L2 : 0);<br>
>   <br>
>       if (cache_policy != L2_BYPASS)<br>
> diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c<br>
> index 92ce1e0699c..6b89a1192d9 100644<br>
> --- a/src/gallium/drivers/radeonsi/si_pipe.c<br>
> +++ b/src/gallium/drivers/radeonsi/si_pipe.c<br>
> @@ -503,28 +503,20 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,<br>
>       si_init_viewport_functions(sctx);<br>
>   <br>
>       if (sctx->chip_class >= CIK)<br>
>               cik_init_sdma_functions(sctx);<br>
>       else<br>
>               si_init_dma_functions(sctx);<br>
>   <br>
>       if (sscreen->debug_flags & DBG(FORCE_DMA))<br>
>               sctx->b.resource_copy_region = sctx->dma_copy;<br>
>   <br>
> -     bool dst_stream_policy = SI_COMPUTE_DST_CACHE_POLICY != L2_LRU;<br>
> -     sctx->cs_clear_buffer = si_create_dma_compute_shader(&sctx->b,<br>
> -                                          SI_COMPUTE_CLEAR_DW_PER_THREAD,<br>
> -                                          dst_stream_policy, false);<br>
> -     sctx->cs_copy_buffer = si_create_dma_compute_shader(&sctx->b,<br>
> -                                          SI_COMPUTE_COPY_DW_PER_THREAD,<br>
> -                                          dst_stream_policy, true);<br>
> -<br>
>       sctx->blitter = util_blitter_create(&sctx->b);<br>
>       if (sctx->blitter == NULL)<br>
>               goto fail;<br>
>       sctx->blitter->skip_viewport_restore = true;<br>
>   <br>
>       si_init_draw_functions(sctx);<br>
>   <br>
>       sctx->sample_mask = 0xffff;<br>
>   <br>
>       if (sctx->chip_class >= GFX9) {<br>
> <br>
</blockquote></div></div>