[Mesa-dev] [PATCH 1/2] radeonsi: Add DMA ring

Marek Olšák maraeo at gmail.com
Thu Mar 13 07:38:45 PDT 2014


On Thu, Mar 13, 2014 at 8:45 AM, Niels Ole Salscheider
<niels_ole at salscheider-online.de> wrote:
> Signed-off-by: Niels Ole Salscheider <niels_ole at salscheider-online.de>
> ---
>  src/gallium/drivers/radeonsi/si_hw_context.c |  3 +++
>  src/gallium/drivers/radeonsi/si_pipe.c       | 22 ++++++++++++++++++++++
>  2 files changed, 25 insertions(+)
>
> diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c
> index c952c8d..d9fba01 100644
> --- a/src/gallium/drivers/radeonsi/si_hw_context.c
> +++ b/src/gallium/drivers/radeonsi/si_hw_context.c
> @@ -123,6 +123,9 @@ void si_context_flush(struct si_context *ctx, unsigned flags)
>  #endif
>
>         /* Flush the CS. */
> +       if (ctx->b.rings.dma.cs) {
> +               ctx->b.ws->cs_flush(ctx->b.rings.dma.cs, flags, 0);
> +       }
>         ctx->b.ws->cs_flush(ctx->b.rings.gfx.cs, flags, 0);

This is a wrong place for flushing the DMA ring, because it always
flushes the graphics ring with it. The DMA flush should be independent
from the graphics flush. See what r600g does.

>
>  #if SI_TRACE_CS
> diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
> index 827e9fe..21cbedf 100644
> --- a/src/gallium/drivers/radeonsi/si_pipe.c
> +++ b/src/gallium/drivers/radeonsi/si_pipe.c
> @@ -74,6 +74,24 @@ static void si_flush_from_winsys(void *ctx, unsigned flags)
>         si_flush((struct pipe_context*)ctx, NULL, flags);
>  }
>
> +static void si_flush_dma_from_st(void *ctx, unsigned flags)
> +{
> +       struct si_context *sctx = (struct si_context *)ctx;
> +       struct radeon_winsys_cs *cs = sctx->b.rings.dma.cs;
> +
> +       if (!cs->cdw) {
> +               return;
> +       }
> +
> +       sctx->b.ws->cs_flush(cs, flags, 0);
> +}
> +
> +static void si_flush_dma_from_winsys(void *ctx, unsigned flags)
> +{
> +       struct si_context *sctx = (struct si_context *)ctx;
> +       sctx->b.rings.dma.flush(sctx, flags);
> +}
> +

Instead of adding these two, you can move the same r600g code to
drivers/radeon/r600_pipe_common.c and just use it there. I'd like all
this DMA ring management to live in drivers/radeon, because it doesn't
depend on r600_context at all.

Marek


More information about the mesa-dev mailing list