From 7f4e39aaf4da3d73e0ab2c2051b1ba5ff6adafc8 Mon Sep 17 00:00:00 2001 From: Antony Clince Alex Date: Tue, 2 Mar 2021 14:18:03 +0530 Subject: [PATCH] gpu: nvgpu: update pma stream teardown sequence On nvgpu-next chips additional steps are required for pma stream teardown. Introduce wrapper function: NVGPU_NEXT_PROFILER_QUIESCE to perform this. Jira NVGPU-5689 Change-Id: Iafdb9c6091b468b51295827467078d24e47d5e1f Signed-off-by: Antony Clince Alex Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2491755 Tested-by: mobile promotions Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert Reviewed-by: Deepak Nibade Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/profiler/profiler.c | 10 +++++++++- drivers/gpu/nvgpu/include/nvgpu/gops/debugger.h | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/common/profiler/profiler.c b/drivers/gpu/nvgpu/common/profiler/profiler.c index e50c17326..f3e1eb5dc 100644 --- a/drivers/gpu/nvgpu/common/profiler/profiler.c +++ b/drivers/gpu/nvgpu/common/profiler/profiler.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -36,6 +36,10 @@ #include #include +#if defined(CONFIG_NVGPU_HAL_NON_FUSA) && defined(CONFIG_NVGPU_NEXT) +#include "nvgpu_next_gpuid.h" +#endif + static int nvgpu_profiler_build_regops_allowlist(struct nvgpu_profiler_object *prof); static void nvgpu_profiler_destroy_regops_allowlist(struct nvgpu_profiler_object *prof); @@ -426,6 +430,10 @@ static int nvgpu_profiler_quiesce_hwpm_streamout_resident(struct nvgpu_profiler_ goto fail; } +#ifdef CONFIG_NVGPU_NEXT + NVGPU_NEXT_PROFILER_QUIESCE(g); +#endif + /* Disable streamout */ g->ops.perf.pma_stream_enable(g, false); diff --git a/drivers/gpu/nvgpu/include/nvgpu/gops/debugger.h b/drivers/gpu/nvgpu/include/nvgpu/gops/debugger.h index 4e93c63bf..0d9ef03c8 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gops/debugger.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gops/debugger.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -101,6 +101,9 @@ struct gops_perf { void (*disable_all_perfmons)(struct gk20a *g); int (*wait_for_idle_pmm_routers)(struct gk20a *g); int (*wait_for_idle_pma)(struct gk20a *g); +#if defined(CONFIG_NVGPU_HAL_NON_FUSA) && defined(CONFIG_NVGPU_NEXT) +#include "include/nvgpu/nvgpu_next_gops_perf.h" +#endif }; struct gops_perfbuf { int (*perfbuf_enable)(struct gk20a *g, u64 offset, u32 size);