diff options
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) { |