diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2017-11-08 05:59:31 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-08 10:57:06 -0500 |
commit | 02d281d0776e2b8305b18823343a2ee972b72657 (patch) | |
tree | a081a24d7e3c3408f7128a54b4ead7289f5bed8a /drivers/gpu/nvgpu/common | |
parent | 86a307871b95a175eb8ecb3033472a112a0720d1 (diff) |
gpu: nvgpu: remove use of linux specific powergate_mode flag
In dbg_set_powergate(), we use flags NVGPU_DBG_GPU_POWERGATE_MODE_DISABLE/ENABLE
which are defined in linux specific uapi header
Hence we need to remove those flags from common code
Update dbg_set_powergate() to receive boolean flag to disable/enable powergate
instead of NVGPU_DBG_GPU_POWERGATE_MODE_DISABLE/ENABLE
Also update corresponding HALs as per above change
Jira NVGPU-259
Change-Id: I9c4eb30e29ea5ce0d8e25517a6a072fb9f0e92e5
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1594326
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_dbg.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c index f8bdd19b..c8d7468e 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c | |||
@@ -178,8 +178,7 @@ int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp) | |||
178 | * calling powergate/timeout enable ioctl | 178 | * calling powergate/timeout enable ioctl |
179 | */ | 179 | */ |
180 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); | 180 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); |
181 | g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, | 181 | g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, false); |
182 | NVGPU_DBG_GPU_POWERGATE_MODE_ENABLE); | ||
183 | nvgpu_dbg_timeout_enable(dbg_s, NVGPU_DBG_GPU_IOCTL_TIMEOUT_ENABLE); | 182 | nvgpu_dbg_timeout_enable(dbg_s, NVGPU_DBG_GPU_IOCTL_TIMEOUT_ENABLE); |
184 | 183 | ||
185 | /* If this session owned the perf buffer, release it */ | 184 | /* If this session owned the perf buffer, release it */ |
@@ -651,7 +650,7 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s, | |||
651 | * disabling/enabling powergating when processing reg ops | 650 | * disabling/enabling powergating when processing reg ops |
652 | */ | 651 | */ |
653 | powergate_err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, | 652 | powergate_err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, |
654 | NVGPU_DBG_GPU_POWERGATE_MODE_DISABLE); | 653 | true); |
655 | is_pg_disabled = true; | 654 | is_pg_disabled = true; |
656 | } | 655 | } |
657 | 656 | ||
@@ -701,7 +700,7 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s, | |||
701 | if (is_pg_disabled) { | 700 | if (is_pg_disabled) { |
702 | powergate_err = | 701 | powergate_err = |
703 | g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, | 702 | g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, |
704 | NVGPU_DBG_GPU_POWERGATE_MODE_ENABLE); | 703 | false); |
705 | } | 704 | } |
706 | } | 705 | } |
707 | 706 | ||
@@ -725,7 +724,14 @@ static int nvgpu_ioctl_powergate_gk20a(struct dbg_session_gk20a *dbg_s, | |||
725 | g->name, args->mode); | 724 | g->name, args->mode); |
726 | 725 | ||
727 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); | 726 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); |
728 | err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, args->mode); | 727 | if (args->mode == NVGPU_DBG_GPU_POWERGATE_MODE_DISABLE) { |
728 | err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, true); | ||
729 | } else if (args->mode == NVGPU_DBG_GPU_POWERGATE_MODE_ENABLE) { | ||
730 | err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, false); | ||
731 | } else { | ||
732 | nvgpu_err(g, "invalid powergate mode"); | ||
733 | err = -EINVAL; | ||
734 | } | ||
729 | nvgpu_mutex_release(&g->dbg_sessions_lock); | 735 | nvgpu_mutex_release(&g->dbg_sessions_lock); |
730 | return err; | 736 | return err; |
731 | } | 737 | } |