[Mesa-dev] [PATCH] radeonsi: allow query functions for compute-only contexts

Marek Olšák maraeo at gmail.com
Mon May 27 23:42:51 UTC 2019


On Mon, May 20, 2019 at 1:04 PM Jan Vesely <jan.vesely at rutgers.edu> wrote:

> On Mon, May 13, 2019 at 6:40 PM Marek Olšák <maraeo at gmail.com> wrote:
> >
> > From: Marek Olšák <marek.olsak at amd.com>
> >
> > ---
> >  src/gallium/drivers/radeonsi/si_pipe.c  | 2 +-
> >  src/gallium/drivers/radeonsi/si_query.c | 7 ++++---
> >  2 files changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/gallium/drivers/radeonsi/si_pipe.c
> b/src/gallium/drivers/radeonsi/si_pipe.c
> > index aa7f012f071..95280675506 100644
> > --- a/src/gallium/drivers/radeonsi/si_pipe.c
> > +++ b/src/gallium/drivers/radeonsi/si_pipe.c
> > @@ -482,29 +482,29 @@ static struct pipe_context
> *si_create_context(struct pipe_screen *screen,
> >         sctx->b.set_device_reset_callback = si_set_device_reset_callback;
> >
> >         si_init_all_descriptors(sctx);
> >         si_init_buffer_functions(sctx);
> >         si_init_clear_functions(sctx);
> >         si_init_blit_functions(sctx);
> >         si_init_compute_functions(sctx);
> >         si_init_compute_blit_functions(sctx);
> >         si_init_debug_functions(sctx);
> >         si_init_fence_functions(sctx);
> > +       si_init_query_functions(sctx);
> >         si_init_state_compute_functions(sctx);
> >
> >         if (sscreen->debug_flags & DBG(FORCE_DMA))
> >                 sctx->b.resource_copy_region = sctx->dma_copy;
> >
> >         /* Initialize graphics-only context functions. */
> >         if (sctx->has_graphics) {
> >                 si_init_context_texture_functions(sctx);
> > -               si_init_query_functions(sctx);
> >                 si_init_msaa_functions(sctx);
> >                 si_init_shader_functions(sctx);
> >                 si_init_state_functions(sctx);
> >                 si_init_streamout_functions(sctx);
> >                 si_init_viewport_functions(sctx);
> >
> >                 sctx->blitter = util_blitter_create(&sctx->b);
> >                 if (sctx->blitter == NULL)
> >                         goto fail;
> >                 sctx->blitter->skip_viewport_restore = true;
> > diff --git a/src/gallium/drivers/radeonsi/si_query.c
> b/src/gallium/drivers/radeonsi/si_query.c
> > index d98bea2eeb3..3e357e8b6c0 100644
> > --- a/src/gallium/drivers/radeonsi/si_query.c
> > +++ b/src/gallium/drivers/radeonsi/si_query.c
> > @@ -1879,23 +1879,24 @@ static int si_get_driver_query_group_info(struct
> pipe_screen *screen,
> >
> >  void si_init_query_functions(struct si_context *sctx)
> >  {
> >         sctx->b.create_query = si_create_query;
> >         sctx->b.create_batch_query = si_create_batch_query;
> >         sctx->b.destroy_query = si_destroy_query;
> >         sctx->b.begin_query = si_begin_query;
> >         sctx->b.end_query = si_end_query;
> >         sctx->b.get_query_result = si_get_query_result;
> >         sctx->b.get_query_result_resource = si_get_query_result_resource;
> > -       sctx->atoms.s.render_cond.emit = si_emit_query_predication;
> >
> > -       if (((struct
> si_screen*)sctx->b.screen)->info.num_render_backends > 0)
> > -           sctx->b.render_condition = si_render_condition;
> > +       if (sctx->has_graphics) {
> > +               sctx->atoms.s.render_cond.emit =
> si_emit_query_predication;
> > +               sctx->b.render_condition = si_render_condition;
> > +       }
> >
> >         LIST_INITHEAD(&sctx->active_queries);
> >  }
> >
> >  void si_init_screen_query_functions(struct si_screen *sscreen)
> >  {
> >         sscreen->b.get_driver_query_info = si_get_driver_query_info;
> >         sscreen->b.get_driver_query_group_info =
> si_get_driver_query_group_info;
> >  }
> > --
> > 2.17.1
>
> Hi,
>
> this patch hangs query requests (tested on carrizo and raven).
>

I've sent a possible fix to mesa-dev: "radeonsi: fix timestamp queries for
compute-only contexts"

Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190527/891aedf5/attachment-0001.html>


More information about the mesa-dev mailing list