diff options
author | Sandarbh Jain <sanjain@nvidia.com> | 2014-04-11 05:16:11 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:09:47 -0400 |
commit | ebe7f110a1d6ebb714354e2739e84e3799ca4b3b (patch) | |
tree | e9a45884ea56bfda97a39634853bd2b6e14785c4 /drivers | |
parent | 6107c44ecd16dce703e653bc6a10f950441b76d4 (diff) |
gpu: nvgpu: gk20a: Control powergating on regops
Enable/disable powergating around regops so that the user
need not call the powergating IOCTLs with the regops IOCTL.
If the user does call the powergating IOCTL then the ref-counting
will ensure the correct behavior.
Bug 1451949
Change-Id: I1746f7d7cd1d2c0c497c213939df44a59d5d2834
Signed-off-by: Sandarbh Jain <sanjain@nvidia.com>
Reviewed-on: http://git-master/r/395131
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c index d1dbf1b6..77806a5e 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | |||
@@ -460,7 +460,9 @@ static bool gr_context_info_available(struct dbg_session_gk20a *dbg_s, | |||
460 | static int nvhost_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s, | 460 | static int nvhost_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s, |
461 | struct nvhost_dbg_gpu_exec_reg_ops_args *args) | 461 | struct nvhost_dbg_gpu_exec_reg_ops_args *args) |
462 | { | 462 | { |
463 | int err; | 463 | int err = 0, powergate_err = 0; |
464 | bool is_pg_disabled = false; | ||
465 | |||
464 | struct device *dev = dbg_s->dev; | 466 | struct device *dev = dbg_s->dev; |
465 | struct gk20a *g = get_gk20a(dbg_s->pdev); | 467 | struct gk20a *g = get_gk20a(dbg_s->pdev); |
466 | struct nvhost_dbg_gpu_reg_op *ops; | 468 | struct nvhost_dbg_gpu_reg_op *ops; |
@@ -503,10 +505,26 @@ static int nvhost_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s, | |||
503 | * on other channels */ | 505 | * on other channels */ |
504 | mutex_lock(&g->dbg_sessions_lock); | 506 | mutex_lock(&g->dbg_sessions_lock); |
505 | 507 | ||
506 | err = dbg_s->ops->exec_reg_ops(dbg_s, ops, args->num_ops); | 508 | if (!dbg_s->is_pg_disabled) { |
509 | powergate_err = dbg_set_powergate(dbg_s, | ||
510 | NVHOST_DBG_GPU_POWERGATE_MODE_DISABLE); | ||
511 | is_pg_disabled = true; | ||
512 | } | ||
513 | |||
514 | if (!powergate_err) { | ||
515 | err = dbg_s->ops->exec_reg_ops(dbg_s, ops, args->num_ops); | ||
516 | /* enable powergate, if previously disabled */ | ||
517 | if (is_pg_disabled) { | ||
518 | powergate_err = dbg_set_powergate(dbg_s, | ||
519 | NVHOST_DBG_GPU_POWERGATE_MODE_ENABLE); | ||
520 | } | ||
521 | } | ||
507 | 522 | ||
508 | mutex_unlock(&g->dbg_sessions_lock); | 523 | mutex_unlock(&g->dbg_sessions_lock); |
509 | 524 | ||
525 | if (!err && powergate_err) | ||
526 | err = powergate_err; | ||
527 | |||
510 | if (err) { | 528 | if (err) { |
511 | gk20a_err(dev, "dbg regops failed"); | 529 | gk20a_err(dev, "dbg regops failed"); |
512 | goto clean_up; | 530 | goto clean_up; |