diff options
author | Sunny He <suhe@nvidia.com> | 2017-06-29 14:16:36 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-07-13 03:09:09 -0400 |
commit | 542ad000f2fb0301fbfb7e6defc6a01eb488906d (patch) | |
tree | 13ee76cd70b5ed771b04e699b3842bb5451bca1a /drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | |
parent | 47cb48f1e2d9c34f22f9fcf443ef67a32cd54a73 (diff) |
gpu: nvgpu: Reorg debug HAL initialization
Reorganize HAL initialization to remove inheritance and construct
the gpu_ops struct at compile time. This patch covers the debug
and dbg_session_ops sub-modules of the gpu_ops struct.
Perform HAL function assignments in hal_gxxxx.c through the
population of a chip-specific copy of gpu_ops.
Jira NVGPU-74
Change-Id: Id51feeccbea91f884a6057efc680566a7d5d0b6d
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1514822
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c index 54986e6c..1572ff48 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | |||
@@ -1277,7 +1277,7 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s, | |||
1277 | return err; | 1277 | return err; |
1278 | } | 1278 | } |
1279 | 1279 | ||
1280 | static int dbg_set_powergate(struct dbg_session_gk20a *dbg_s, u32 powermode) | 1280 | int dbg_set_powergate(struct dbg_session_gk20a *dbg_s, u32 powermode) |
1281 | { | 1281 | { |
1282 | int err = 0; | 1282 | int err = 0; |
1283 | struct gk20a *g = dbg_s->g; | 1283 | struct gk20a *g = dbg_s->g; |
@@ -1646,7 +1646,7 @@ static struct dbg_profiler_object_data *find_matching_prof_obj( | |||
1646 | return NULL; | 1646 | return NULL; |
1647 | } | 1647 | } |
1648 | 1648 | ||
1649 | static bool nvgpu_check_and_set_global_reservation( | 1649 | bool nvgpu_check_and_set_global_reservation( |
1650 | struct dbg_session_gk20a *dbg_s, | 1650 | struct dbg_session_gk20a *dbg_s, |
1651 | struct dbg_profiler_object_data *prof_obj) | 1651 | struct dbg_profiler_object_data *prof_obj) |
1652 | { | 1652 | { |
@@ -1662,7 +1662,7 @@ static bool nvgpu_check_and_set_global_reservation( | |||
1662 | return false; | 1662 | return false; |
1663 | } | 1663 | } |
1664 | 1664 | ||
1665 | static bool nvgpu_check_and_set_context_reservation( | 1665 | bool nvgpu_check_and_set_context_reservation( |
1666 | struct dbg_session_gk20a *dbg_s, | 1666 | struct dbg_session_gk20a *dbg_s, |
1667 | struct dbg_profiler_object_data *prof_obj) | 1667 | struct dbg_profiler_object_data *prof_obj) |
1668 | { | 1668 | { |
@@ -1677,7 +1677,7 @@ static bool nvgpu_check_and_set_context_reservation( | |||
1677 | return true; | 1677 | return true; |
1678 | } | 1678 | } |
1679 | 1679 | ||
1680 | static void nvgpu_release_profiler_reservation(struct dbg_session_gk20a *dbg_s, | 1680 | void nvgpu_release_profiler_reservation(struct dbg_session_gk20a *dbg_s, |
1681 | struct dbg_profiler_object_data *prof_obj) | 1681 | struct dbg_profiler_object_data *prof_obj) |
1682 | { | 1682 | { |
1683 | struct gk20a *g = dbg_s->g; | 1683 | struct gk20a *g = dbg_s->g; |
@@ -1834,7 +1834,7 @@ static int nvgpu_ioctl_profiler_reserve(struct dbg_session_gk20a *dbg_s, | |||
1834 | return nvgpu_profiler_reserve_release(dbg_s, args->profiler_handle); | 1834 | return nvgpu_profiler_reserve_release(dbg_s, args->profiler_handle); |
1835 | } | 1835 | } |
1836 | 1836 | ||
1837 | static int gk20a_perfbuf_enable_locked(struct gk20a *g, u64 offset, u32 size) | 1837 | int gk20a_perfbuf_enable_locked(struct gk20a *g, u64 offset, u32 size) |
1838 | { | 1838 | { |
1839 | struct mm_gk20a *mm = &g->mm; | 1839 | struct mm_gk20a *mm = &g->mm; |
1840 | u32 virt_addr_lo; | 1840 | u32 virt_addr_lo; |
@@ -1943,7 +1943,7 @@ err_remove_vm: | |||
1943 | } | 1943 | } |
1944 | 1944 | ||
1945 | /* must be called with dbg_sessions_lock held */ | 1945 | /* must be called with dbg_sessions_lock held */ |
1946 | static int gk20a_perfbuf_disable_locked(struct gk20a *g) | 1946 | int gk20a_perfbuf_disable_locked(struct gk20a *g) |
1947 | { | 1947 | { |
1948 | int err = gk20a_busy(g); | 1948 | int err = gk20a_busy(g); |
1949 | if (err) { | 1949 | if (err) { |
@@ -2002,17 +2002,3 @@ static int gk20a_perfbuf_unmap(struct dbg_session_gk20a *dbg_s, | |||
2002 | 2002 | ||
2003 | return err; | 2003 | return err; |
2004 | } | 2004 | } |
2005 | |||
2006 | void gk20a_init_dbg_session_ops(struct gpu_ops *gops) | ||
2007 | { | ||
2008 | gops->dbg_session_ops.exec_reg_ops = exec_regops_gk20a; | ||
2009 | gops->dbg_session_ops.dbg_set_powergate = dbg_set_powergate; | ||
2010 | gops->dbg_session_ops.check_and_set_global_reservation = | ||
2011 | nvgpu_check_and_set_global_reservation; | ||
2012 | gops->dbg_session_ops.check_and_set_context_reservation = | ||
2013 | nvgpu_check_and_set_context_reservation; | ||
2014 | gops->dbg_session_ops.release_profiler_reservation = | ||
2015 | nvgpu_release_profiler_reservation; | ||
2016 | gops->dbg_session_ops.perfbuffer_enable = gk20a_perfbuf_enable_locked; | ||
2017 | gops->dbg_session_ops.perfbuffer_disable = gk20a_perfbuf_disable_locked; | ||
2018 | }; | ||