mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 18:16:01 +03:00
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>
This commit is contained in:
committed by
mobile promotions
parent
86a307871b
commit
02d281d077
@@ -178,8 +178,7 @@ int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp)
|
||||
* calling powergate/timeout enable ioctl
|
||||
*/
|
||||
nvgpu_mutex_acquire(&g->dbg_sessions_lock);
|
||||
g->ops.dbg_session_ops.dbg_set_powergate(dbg_s,
|
||||
NVGPU_DBG_GPU_POWERGATE_MODE_ENABLE);
|
||||
g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, false);
|
||||
nvgpu_dbg_timeout_enable(dbg_s, NVGPU_DBG_GPU_IOCTL_TIMEOUT_ENABLE);
|
||||
|
||||
/* 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,
|
||||
* disabling/enabling powergating when processing reg ops
|
||||
*/
|
||||
powergate_err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s,
|
||||
NVGPU_DBG_GPU_POWERGATE_MODE_DISABLE);
|
||||
true);
|
||||
is_pg_disabled = true;
|
||||
}
|
||||
|
||||
@@ -701,7 +700,7 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s,
|
||||
if (is_pg_disabled) {
|
||||
powergate_err =
|
||||
g->ops.dbg_session_ops.dbg_set_powergate(dbg_s,
|
||||
NVGPU_DBG_GPU_POWERGATE_MODE_ENABLE);
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -725,7 +724,14 @@ static int nvgpu_ioctl_powergate_gk20a(struct dbg_session_gk20a *dbg_s,
|
||||
g->name, args->mode);
|
||||
|
||||
nvgpu_mutex_acquire(&g->dbg_sessions_lock);
|
||||
err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, args->mode);
|
||||
if (args->mode == NVGPU_DBG_GPU_POWERGATE_MODE_DISABLE) {
|
||||
err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, true);
|
||||
} else if (args->mode == NVGPU_DBG_GPU_POWERGATE_MODE_ENABLE) {
|
||||
err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, false);
|
||||
} else {
|
||||
nvgpu_err(g, "invalid powergate mode");
|
||||
err = -EINVAL;
|
||||
}
|
||||
nvgpu_mutex_release(&g->dbg_sessions_lock);
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user