<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 20, 2019 at 1:04 PM Jan Vesely <<a href="mailto:jan.vesely@rutgers.edu">jan.vesely@rutgers.edu</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">On Mon, May 13, 2019 at 6:40 PM Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>> wrote:<br>
><br>
> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
><br>
> ---<br>
> src/gallium/drivers/radeonsi/si_pipe.c | 2 +-<br>
> src/gallium/drivers/radeonsi/si_query.c | 7 ++++---<br>
> 2 files changed, 5 insertions(+), 4 deletions(-)<br>
><br>
> diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c<br>
> index aa7f012f071..95280675506 100644<br>
> --- a/src/gallium/drivers/radeonsi/si_pipe.c<br>
> +++ b/src/gallium/drivers/radeonsi/si_pipe.c<br>
> @@ -482,29 +482,29 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,<br>
> sctx->b.set_device_reset_callback = si_set_device_reset_callback;<br>
><br>
> si_init_all_descriptors(sctx);<br>
> si_init_buffer_functions(sctx);<br>
> si_init_clear_functions(sctx);<br>
> si_init_blit_functions(sctx);<br>
> si_init_compute_functions(sctx);<br>
> si_init_compute_blit_functions(sctx);<br>
> si_init_debug_functions(sctx);<br>
> si_init_fence_functions(sctx);<br>
> + si_init_query_functions(sctx);<br>
> si_init_state_compute_functions(sctx);<br>
><br>
> if (sscreen->debug_flags & DBG(FORCE_DMA))<br>
> sctx->b.resource_copy_region = sctx->dma_copy;<br>
><br>
> /* Initialize graphics-only context functions. */<br>
> if (sctx->has_graphics) {<br>
> si_init_context_texture_functions(sctx);<br>
> - si_init_query_functions(sctx);<br>
> si_init_msaa_functions(sctx);<br>
> si_init_shader_functions(sctx);<br>
> si_init_state_functions(sctx);<br>
> si_init_streamout_functions(sctx);<br>
> si_init_viewport_functions(sctx);<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>
> diff --git a/src/gallium/drivers/radeonsi/si_query.c b/src/gallium/drivers/radeonsi/si_query.c<br>
> index d98bea2eeb3..3e357e8b6c0 100644<br>
> --- a/src/gallium/drivers/radeonsi/si_query.c<br>
> +++ b/src/gallium/drivers/radeonsi/si_query.c<br>
> @@ -1879,23 +1879,24 @@ static int si_get_driver_query_group_info(struct pipe_screen *screen,<br>
><br>
> void si_init_query_functions(struct si_context *sctx)<br>
> {<br>
> sctx->b.create_query = si_create_query;<br>
> sctx->b.create_batch_query = si_create_batch_query;<br>
> sctx->b.destroy_query = si_destroy_query;<br>
> sctx->b.begin_query = si_begin_query;<br>
> sctx->b.end_query = si_end_query;<br>
> sctx->b.get_query_result = si_get_query_result;<br>
> sctx->b.get_query_result_resource = si_get_query_result_resource;<br>
> - sctx->atoms.s.render_cond.emit = si_emit_query_predication;<br>
><br>
> - if (((struct si_screen*)sctx->b.screen)->info.num_render_backends > 0)<br>
> - sctx->b.render_condition = si_render_condition;<br>
> + if (sctx->has_graphics) {<br>
> + sctx->atoms.s.render_cond.emit = si_emit_query_predication;<br>
> + sctx->b.render_condition = si_render_condition;<br>
> + }<br>
><br>
> LIST_INITHEAD(&sctx->active_queries);<br>
> }<br>
><br>
> void si_init_screen_query_functions(struct si_screen *sscreen)<br>
> {<br>
> sscreen->b.get_driver_query_info = si_get_driver_query_info;<br>
> sscreen->b.get_driver_query_group_info = si_get_driver_query_group_info;<br>
> }<br>
> --<br>
> 2.17.1<br>
<br>
Hi,<br>
<br>
this patch hangs query requests (tested on carrizo and raven).<br></blockquote><div><br></div><div>I've sent a possible fix to mesa-dev: "radeonsi: fix timestamp queries for compute-only contexts"</div><div><br></div><div>Marek</div><br></div></div>