diff options
author | Peter Daifuku <pdaifuku@nvidia.com> | 2016-03-09 22:10:20 -0500 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-04-07 14:05:49 -0400 |
commit | 37155b65f1dd6039bdef92f513d86640956bc12c (patch) | |
tree | 1deb57523c3acc445996c642da6ac96e1cf7c355 /drivers/gpu/nvgpu/gk20a/regops_gk20a.c | |
parent | 6675c03603669c667c6ffec34567eaf101a2d09d (diff) |
gpu: nvgpu: support for hwpm context switching
Add support for hwpm context switching
Bug 1648200
Change-Id: I482899bf165cd2ef24bb8617be16df01218e462f
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: http://git-master/r/1120450
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/regops_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/regops_gk20a.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c index 1696f759..e6162af2 100644 --- a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Tegra GK20A GPU Debugger Driver Register Ops | 2 | * Tegra GK20A GPU Debugger Driver Register Ops |
3 | * | 3 | * |
4 | * Copyright (c) 2013-2015, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2013-2016, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -644,22 +644,31 @@ static int validate_reg_op_offset(struct dbg_session_gk20a *dbg_s, | |||
644 | valid = check_whitelists(dbg_s, op, offset + 4); | 644 | valid = check_whitelists(dbg_s, op, offset + 4); |
645 | 645 | ||
646 | if (valid && (op->type != REGOP(TYPE_GLOBAL))) { | 646 | if (valid && (op->type != REGOP(TYPE_GLOBAL))) { |
647 | err = gr_gk20a_get_ctx_buffer_offsets(dbg_s->g, | 647 | err = gr_gk20a_get_ctx_buffer_offsets(dbg_s->g, |
648 | op->offset, | ||
649 | 1, | ||
650 | &buf_offset_lo, | ||
651 | &buf_offset_addr, | ||
652 | &num_offsets, | ||
653 | op->type == REGOP(TYPE_GR_CTX_QUAD), | ||
654 | op->quad); | ||
655 | if (err) { | ||
656 | err = gr_gk20a_get_pm_ctx_buffer_offsets(dbg_s->g, | ||
648 | op->offset, | 657 | op->offset, |
649 | 1, | 658 | 1, |
650 | &buf_offset_lo, | 659 | &buf_offset_lo, |
651 | &buf_offset_addr, | 660 | &buf_offset_addr, |
652 | &num_offsets, | 661 | &num_offsets); |
653 | op->type == REGOP(TYPE_GR_CTX_QUAD), | 662 | |
654 | op->quad); | ||
655 | if (err) { | 663 | if (err) { |
656 | op->status |= REGOP(STATUS_INVALID_OFFSET); | 664 | op->status |= REGOP(STATUS_INVALID_OFFSET); |
657 | return -EINVAL; | 665 | return -EINVAL; |
658 | } | 666 | } |
659 | if (!buf_offset_lo) { | 667 | } |
660 | op->status |= REGOP(STATUS_INVALID_OFFSET); | 668 | if (!buf_offset_lo) { |
661 | return -EINVAL; | 669 | op->status |= REGOP(STATUS_INVALID_OFFSET); |
662 | } | 670 | return -EINVAL; |
671 | } | ||
663 | } | 672 | } |
664 | 673 | ||
665 | if (!valid) { | 674 | if (!valid) { |