diff options
author | Aingara Paramakuru <aparamakuru@nvidia.com> | 2014-12-24 12:24:33 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-04-04 21:03:43 -0400 |
commit | 624d7a2830370ec13402b964a1c8ff564249ddb6 (patch) | |
tree | 5ac2f3f5eef19db41ebecf4567bdc459aad02218 /drivers/gpu/nvgpu/vgpu/gr_vgpu.c | |
parent | f6587d13e4b33cd45841c42bd493faae8a7a7658 (diff) |
gpu: nvgpu: vgpu: handle fifo and gr exceptions
Handle the gr and fifo exceptions delivered from the server
and update the channel state as needed.
Bug 1551865
Change-Id: Ie19626c6e8a72f92ffd134983fe6d84e5c6c8736
Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com>
Reviewed-on: http://git-master/r/670329
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/gr_vgpu.c')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/gr_vgpu.c | 71 |
1 files changed, 42 insertions, 29 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c index b1a8027e..aac097d9 100644 --- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Virtualized GPU Graphics | 2 | * Virtualized GPU Graphics |
3 | * | 3 | * |
4 | * Copyright (c) 2014 NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2014-2015, 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, |
@@ -668,38 +668,51 @@ int vgpu_init_gr_support(struct gk20a *g) | |||
668 | return vgpu_gr_init_gr_setup_sw(g); | 668 | return vgpu_gr_init_gr_setup_sw(g); |
669 | } | 669 | } |
670 | 670 | ||
671 | struct gr_isr_data { | ||
672 | u32 addr; | ||
673 | u32 data_lo; | ||
674 | u32 data_hi; | ||
675 | u32 curr_ctx; | ||
676 | u32 chid; | ||
677 | u32 offset; | ||
678 | u32 sub_chan; | ||
679 | u32 class_num; | ||
680 | }; | ||
681 | |||
682 | static int vgpu_gr_handle_notify_pending(struct gk20a *g, | ||
683 | struct gr_isr_data *isr_data) | ||
684 | { | ||
685 | struct fifo_gk20a *f = &g->fifo; | ||
686 | struct channel_gk20a *ch = &f->channel[isr_data->chid]; | ||
687 | |||
688 | gk20a_dbg_fn(""); | ||
689 | wake_up(&ch->notifier_wq); | ||
690 | return 0; | ||
691 | } | ||
692 | |||
693 | int vgpu_gr_isr(struct gk20a *g, struct tegra_vgpu_gr_intr_info *info) | 671 | int vgpu_gr_isr(struct gk20a *g, struct tegra_vgpu_gr_intr_info *info) |
694 | { | 672 | { |
695 | struct gr_isr_data isr_data; | 673 | struct fifo_gk20a *f = &g->fifo; |
674 | struct channel_gk20a *ch = &f->channel[info->chid]; | ||
696 | 675 | ||
697 | gk20a_dbg_fn(""); | 676 | gk20a_dbg_fn(""); |
698 | 677 | if (info->type != TEGRA_VGPU_GR_INTR_NOTIFY) | |
699 | isr_data.chid = info->chid; | 678 | gk20a_err(dev_from_gk20a(g), "gr intr (%d) on ch %u", |
700 | 679 | info->type, info->chid); | |
701 | if (info->type == TEGRA_VGPU_GR_INTR_NOTIFY) | 680 | |
702 | vgpu_gr_handle_notify_pending(g, &isr_data); | 681 | switch (info->type) { |
682 | case TEGRA_VGPU_GR_INTR_NOTIFY: | ||
683 | wake_up(&ch->notifier_wq); | ||
684 | break; | ||
685 | case TEGRA_VGPU_GR_INTR_SEMAPHORE_TIMEOUT: | ||
686 | gk20a_set_error_notifier(ch, | ||
687 | NVGPU_CHANNEL_GR_SEMAPHORE_TIMEOUT); | ||
688 | break; | ||
689 | case TEGRA_VGPU_GR_INTR_ILLEGAL_NOTIFY: | ||
690 | gk20a_set_error_notifier(ch, | ||
691 | NVGPU_CHANNEL_GR_ILLEGAL_NOTIFY); | ||
692 | case TEGRA_VGPU_GR_INTR_ILLEGAL_METHOD: | ||
693 | break; | ||
694 | case TEGRA_VGPU_GR_INTR_ILLEGAL_CLASS: | ||
695 | gk20a_set_error_notifier(ch, | ||
696 | NVGPU_CHANNEL_GR_ERROR_SW_NOTIFY); | ||
697 | break; | ||
698 | case TEGRA_VGPU_GR_INTR_FECS_ERROR: | ||
699 | break; | ||
700 | case TEGRA_VGPU_GR_INTR_CLASS_ERROR: | ||
701 | gk20a_set_error_notifier(ch, | ||
702 | NVGPU_CHANNEL_GR_ERROR_SW_NOTIFY); | ||
703 | break; | ||
704 | case TEGRA_VGPU_GR_INTR_FIRMWARE_METHOD: | ||
705 | gk20a_set_error_notifier(ch, | ||
706 | NVGPU_CHANNEL_GR_ERROR_SW_NOTIFY); | ||
707 | break; | ||
708 | case TEGRA_VGPU_GR_INTR_EXCEPTION: | ||
709 | gk20a_set_error_notifier(ch, | ||
710 | NVGPU_CHANNEL_GR_ERROR_SW_NOTIFY); | ||
711 | break; | ||
712 | default: | ||
713 | WARN_ON(1); | ||
714 | break; | ||
715 | } | ||
703 | 716 | ||
704 | return 0; | 717 | return 0; |
705 | } | 718 | } |