summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
diff options
context:
space:
mode:
authorSeema Khowala <seemaj@nvidia.com>2017-10-06 13:49:21 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-10 12:24:45 -0400
commitbf8dca77aee16b98a89e8ef5491907f2a791f1ff (patch)
tree402f2e14786cbc35d1de6fda7c5f2bf289ac788f /drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
parent7bbbacee217b6b033104a2939c093549fd7084a9 (diff)
gpu: nvgpu: add null check for perfbuffer enable and disable dbg ops
This is needed to disable/enable features on new chips Bug 200352825 Change-Id: I02eb58e6fdd554ed20866fe8a8553a667541f512 Signed-off-by: Seema Khowala <seemaj@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1574481 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
index d1eff233..c3cb0f4c 100644
--- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
@@ -1911,10 +1911,15 @@ static int gk20a_perfbuf_map(struct dbg_session_gk20a *dbg_s,
1911 struct mm_gk20a *mm = &g->mm; 1911 struct mm_gk20a *mm = &g->mm;
1912 int err; 1912 int err;
1913 u32 virt_size; 1913 u32 virt_size;
1914 u32 big_page_size = g->ops.mm.get_default_big_page_size(); 1914 u32 big_page_size;
1915
1916 if (!g->ops.dbg_session_ops.perfbuffer_enable)
1917 return -ENOSYS;
1915 1918
1916 nvgpu_mutex_acquire(&g->dbg_sessions_lock); 1919 nvgpu_mutex_acquire(&g->dbg_sessions_lock);
1917 1920
1921 big_page_size = g->ops.mm.get_default_big_page_size();
1922
1918 if (g->perfbuf.owner) { 1923 if (g->perfbuf.owner) {
1919 nvgpu_mutex_release(&g->dbg_sessions_lock); 1924 nvgpu_mutex_release(&g->dbg_sessions_lock);
1920 return -EBUSY; 1925 return -EBUSY;
@@ -2015,6 +2020,9 @@ static int gk20a_perfbuf_unmap(struct dbg_session_gk20a *dbg_s,
2015 struct gk20a *g = dbg_s->g; 2020 struct gk20a *g = dbg_s->g;
2016 int err; 2021 int err;
2017 2022
2023 if (!g->ops.dbg_session_ops.perfbuffer_disable)
2024 return -ENOSYS;
2025
2018 nvgpu_mutex_acquire(&g->dbg_sessions_lock); 2026 nvgpu_mutex_acquire(&g->dbg_sessions_lock);
2019 if ((g->perfbuf.owner != dbg_s) || 2027 if ((g->perfbuf.owner != dbg_s) ||
2020 (g->perfbuf.offset != args->offset)) { 2028 (g->perfbuf.offset != args->offset)) {