[Mesa-dev] [PATCH 1/2] r600g, radeonsi: Assert that there's enough space after flushing

Marek Olšák maraeo at gmail.com
Tue May 26 02:44:08 PDT 2015


For the series:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Tue, May 26, 2015 at 9:28 AM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>  src/gallium/drivers/radeon/r600_pipe_common.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
> index 42e681d..3def444 100644
> --- a/src/gallium/drivers/radeon/r600_pipe_common.c
> +++ b/src/gallium/drivers/radeon/r600_pipe_common.c
> @@ -107,11 +107,10 @@ void r600_draw_rectangle(struct blitter_context *blitter,
>
>  void r600_need_dma_space(struct r600_common_context *ctx, unsigned num_dw)
>  {
> -       /* The number of dwords we already used in the DMA so far. */
> -       num_dw += ctx->rings.dma.cs->cdw;
>         /* Flush if there's not enough space. */
> -       if (num_dw > RADEON_MAX_CMDBUF_DWORDS) {
> +       if ((num_dw + ctx->rings.dma.cs->cdw) > RADEON_MAX_CMDBUF_DWORDS) {
>                 ctx->rings.dma.flush(ctx, RADEON_FLUSH_ASYNC, NULL);
> +               assert((num_dw + ctx->rings.dma.cs->cdw) <= RADEON_MAX_CMDBUF_DWORDS);
>         }
>  }
>
> --
> 2.1.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list