[Mesa-dev] [PATCH] radv: fix trace dumping for !use_ib_bos

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Sun Jun 11 14:33:18 UTC 2017


Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

We shouldn't chain when use_ib_bos is false and embed secondary
command buffers directly in the primary buffer as well, so no handling
of chaining is needed.

On Sun, Jun 11, 2017 at 4:03 PM, Grazvydas Ignotas <notasas at gmail.com> wrote:
> Fixes trace dumping crash for SI or when RADV_DEBUG=noibs is set.
>
> Fixes: 97dfff5410 "radv: Dump command buffer on hang."
> Signed-off-by: Grazvydas Ignotas <notasas at gmail.com>
> ---
> Not sure if chained buffer dumping can be done for !use_ib_bos,
> returning NULL in _get_cpu_addr() just skips that.
>
>  src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
> index 7b74970..ffc7566 100644
> --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
> +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
> @@ -950,10 +950,13 @@ static int radv_amdgpu_winsys_cs_submit(struct radeon_winsys_ctx *_ctx,
>
>  static void *radv_amdgpu_winsys_get_cpu_addr(void *_cs, uint64_t addr)
>  {
>         struct radv_amdgpu_cs *cs = (struct radv_amdgpu_cs *)_cs;
>         void *ret = NULL;
> +
> +       if (!cs->ib_buffer)
> +               return NULL;
>         for (unsigned i = 0; i <= cs->num_old_ib_buffers; ++i) {
>                 struct radv_amdgpu_winsys_bo *bo;
>
>                 bo = (struct radv_amdgpu_winsys_bo*)
>                        (i == cs->num_old_ib_buffers ? cs->ib_buffer : cs->old_ib_buffers[i]);
> @@ -968,14 +971,19 @@ static void *radv_amdgpu_winsys_get_cpu_addr(void *_cs, uint64_t addr)
>  static void radv_amdgpu_winsys_cs_dump(struct radeon_winsys_cs *_cs,
>                                         FILE* file,
>                                         uint32_t trace_id)
>  {
>         struct radv_amdgpu_cs *cs = (struct radv_amdgpu_cs *)_cs;
> +       void *ib = cs->base.buf;
> +       int num_dw = cs->base.cdw;
>
> -       ac_parse_ib(file,
> -                   radv_amdgpu_winsys_get_cpu_addr(cs, cs->ib.ib_mc_address),
> -                   cs->ib.size, trace_id,  "main IB", cs->ws->info.chip_class,
> +       if (cs->ws->use_ib_bos) {
> +               ib = radv_amdgpu_winsys_get_cpu_addr(cs, cs->ib.ib_mc_address);
> +               num_dw = cs->ib.size;
> +       }
> +       assert(ib);
> +       ac_parse_ib(file, ib, num_dw, trace_id, "main IB", cs->ws->info.chip_class,
>                     radv_amdgpu_winsys_get_cpu_addr, cs);
>  }
>
>  static struct radeon_winsys_ctx *radv_amdgpu_ctx_create(struct radeon_winsys *_ws)
>  {
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list