<div dir="ltr"><div><div>Hi Juan,<br><br></div>Here is the patch backported to 18.0:<br><a href="https://cgit.freedesktop.org/~mareko/mesa/commit/?h=amd-18.0&id=7ab59306613b08c7dd6e875c3276cac9a61889ae">https://cgit.freedesktop.org/~mareko/mesa/commit/?h=amd-18.0&id=7ab59306613b08c7dd6e875c3276cac9a61889ae</a><br><br></div>Marek<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 20, 2018 at 10:57 AM, Juan A. Suarez Romero <span dir="ltr"><<a href="mailto:jasuarez@igalia.com" target="_blank">jasuarez@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, 2018-04-17 at 15:54 -0400, Marek Olšák wrote:<br>
> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br>
> <br>
> This packet causes the no-op IB detection to fail, so the IB is always<br>
> submitted. Also fix the no-op IB detection by moving the begin call.<br>
> <br>
> Cc: 18.0 <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.<wbr>freedesktop.org</a>><br>
<br>
<br>
</span>This patch does not apply cleanly in 18.0, so I've resolved the conflicts.<br>
<br>
Please, take a look at [1] to see if it is everything correct. Thanks in<br>
advance!<br>
<br>
<br>
[1] <a href="https://github.com/Igalia/release-mesa/commit/68768a94b21d2c20e45ebae29698c4
f40f43e18f" rel="noreferrer" target="_blank">https://github.com/Igalia/<wbr>release-mesa/commit/<wbr>68768a94b21d2c20e45ebae29698c4<br>
f40f43e18f</a><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
        J.A.<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
> ---<br>
>  src/gallium/drivers/radeonsi/<wbr>si_pipe.c | 7 ++++---<br>
>  1 file changed, 4 insertions(+), 3 deletions(-)<br>
> <br>
> diff --git a/src/gallium/drivers/<wbr>radeonsi/si_pipe.c b/src/gallium/drivers/<wbr>radeonsi/si_pipe.c<br>
> index d044b191b71..ac16aae3078 100644<br>
> --- a/src/gallium/drivers/<wbr>radeonsi/si_pipe.c<br>
> +++ b/src/gallium/drivers/<wbr>radeonsi/si_pipe.c<br>
> @@ -522,38 +522,37 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,<br>
>               sctx->b.resource_copy_region = sctx->dma_copy;<br>
>  <br>
>       sctx->blitter = util_blitter_create(&sctx->b);<br>
>       if (sctx->blitter == NULL)<br>
>               goto fail;<br>
>       sctx->blitter->draw_rectangle = si_draw_rectangle;<br>
>       sctx->blitter->skip_viewport_<wbr>restore = true;<br>
>  <br>
>       sctx->sample_mask = 0xffff;<br>
>  <br>
> -     /* these must be last */<br>
> -     si_begin_new_gfx_cs(sctx);<br>
> -<br>
>       if (sctx->chip_class >= GFX9) {<br>
>               sctx->wait_mem_scratch = r600_resource(<br>
>                       pipe_buffer_create(screen, 0, PIPE_USAGE_DEFAULT, 4));<br>
>               if (!sctx->wait_mem_scratch)<br>
>                       goto fail;<br>
>  <br>
>               /* Initialize the memory. */<br>
>               struct radeon_winsys_cs *cs = sctx->gfx_cs;<br>
>               radeon_emit(cs, PKT3(PKT3_WRITE_DATA, 3, 0));<br>
>               radeon_emit(cs, S_370_DST_SEL(V_370_MEMORY_<wbr>SYNC) |<br>
>                           S_370_WR_CONFIRM(1) |<br>
>                           S_370_ENGINE_SEL(V_370_ME));<br>
>               radeon_emit(cs, sctx->wait_mem_scratch->gpu_<wbr>address);<br>
>               radeon_emit(cs, sctx->wait_mem_scratch->gpu_<wbr>address >> 32);<br>
>               radeon_emit(cs, sctx->wait_mem_number);<br>
> +             radeon_add_to_buffer_list(<wbr>sctx, cs, sctx->wait_mem_scratch,<br>
> +                                       RADEON_USAGE_WRITE, RADEON_PRIO_FENCE);<br>
>       }<br>
>  <br>
>       /* CIK cannot unbind a constant buffer (S_BUFFER_LOAD doesn't skip loads<br>
>        * if NUM_RECORDS == 0). We need to use a dummy buffer instead. */<br>
>       if (sctx->chip_class == CIK) {<br>
>               sctx->null_const_buf.buffer =<br>
>                       pipe_aligned_buffer_create(<wbr>screen,<br>
>                                                  SI_RESOURCE_FLAG_32BIT,<br>
>                                                  PIPE_USAGE_DEFAULT, 16,<br>
>                                                  sctx->screen->info.tcc_cache_<wbr>line_size);<br>
> @@ -612,20 +611,22 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,<br>
>                                                   _mesa_key_pointer_equal);<br>
>       sctx->img_handles = _mesa_hash_table_create(NULL, _mesa_hash_pointer,<br>
>                                                   _mesa_key_pointer_equal);<br>
>  <br>
>       util_dynarray_init(&sctx-><wbr>resident_tex_handles, NULL);<br>
>       util_dynarray_init(&sctx-><wbr>resident_img_handles, NULL);<br>
>       util_dynarray_init(&sctx-><wbr>resident_tex_needs_color_<wbr>decompress, NULL);<br>
>       util_dynarray_init(&sctx-><wbr>resident_img_needs_color_<wbr>decompress, NULL);<br>
>       util_dynarray_init(&sctx-><wbr>resident_tex_needs_depth_<wbr>decompress, NULL);<br>
>  <br>
> +     /* this must be last */<br>
> +     si_begin_new_gfx_cs(sctx);<br>
>       return &sctx->b;<br>
>  fail:<br>
>       fprintf(stderr, "radeonsi: Failed to create a context.\n");<br>
>       si_destroy_context(&sctx->b);<br>
>       return NULL;<br>
>  }<br>
>  <br>
>  static struct pipe_context *si_pipe_create_context(struct pipe_screen *screen,<br>
>                                                  void *priv, unsigned flags)<br>
>  {<br>
</div></div></blockquote></div><br></div>