From d654ab48638b0160ccef6f7be0faa8b3b3ee1fab Mon Sep 17 00:00:00 2001 From: Aparna Das Date: Thu, 15 Feb 2018 12:42:08 -0800 Subject: [PATCH] gpu: nvgpu: add hal op to handle notify pending The vserver variant for gr handle notify pending needs different functionality to send interrupt to VM. Add HAL operation to allow overriding vserver usecase. Jira VQRM-2982 Change-Id: I4cb88d4d769a5d5cb98a4ee6ac3fbb74245cb5f2 Signed-off-by: Aparna Das Reviewed-on: https://git-master.nvidia.com/r/1658255 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 2 ++ drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 4 ++-- drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 2 ++ drivers/gpu/nvgpu/gm20b/hal_gm20b.c | 1 + drivers/gpu/nvgpu/gp106/hal_gp106.c | 1 + drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 1 + drivers/gpu/nvgpu/gv100/hal_gv100.c | 1 + drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 1 + 8 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 843920258..d9e3c97d6 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -445,6 +445,8 @@ struct gpu_ops { int (*handle_ssync_hww)(struct gk20a *g); void (*set_error_notifier)(struct gk20a *g, struct gr_gk20a_isr_data *isr_data, u32 error_notifier); + int (*handle_notify_pending)(struct gk20a *g, + struct gr_gk20a_isr_data *isr_data); } gr; struct { void (*init_hw)(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index b37ae8cd5..8f263e677 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -5302,7 +5302,7 @@ static inline bool is_valid_cyclestats_bar0_offset_gk20a(struct gk20a *g, } #endif -static int gk20a_gr_handle_notify_pending(struct gk20a *g, +int gk20a_gr_handle_notify_pending(struct gk20a *g, struct gr_gk20a_isr_data *isr_data) { struct fifo_gk20a *f = &g->fifo; @@ -5891,7 +5891,7 @@ int gk20a_gr_isr(struct gk20a *g) isr_data.sub_chan, isr_data.class_num); if (gr_intr & gr_intr_notify_pending_f()) { - gk20a_gr_handle_notify_pending(g, &isr_data); + g->ops.gr.handle_notify_pending(g, &isr_data); gk20a_writel(g, gr_intr_r(), gr_intr_notify_reset_f()); gr_intr &= ~gr_intr_notify_pending_f(); diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index d1ba63534..1bf58f5c8 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -800,4 +800,6 @@ void gk20a_gr_init_ctxsw_hdr_data(struct gk20a *g, u32 gr_gk20a_get_patch_slots(struct gk20a *g); void gk20a_gr_set_error_notifier(struct gk20a *g, struct gr_gk20a_isr_data *isr_data, u32 error_notifier); +int gk20a_gr_handle_notify_pending(struct gk20a *g, + struct gr_gk20a_isr_data *isr_data); #endif /*__GR_GK20A_H__*/ diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index 7425dc37a..2d53a9269 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c @@ -312,6 +312,7 @@ static const struct gpu_ops gm20b_ops = { .init_ctxsw_hdr_data = gk20a_gr_init_ctxsw_hdr_data, .fecs_host_int_enable = gr_gk20a_fecs_host_int_enable, .set_error_notifier = gk20a_gr_set_error_notifier, + .handle_notify_pending = gk20a_gr_handle_notify_pending, }, .fb = { .reset = fb_gk20a_reset, diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 2fa8359e3..a0068a6f8 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -374,6 +374,7 @@ static const struct gpu_ops gp106_ops = { .load_ctxsw_ucode = gr_gm20b_load_ctxsw_ucode, .fecs_host_int_enable = gr_gk20a_fecs_host_int_enable, .set_error_notifier = gk20a_gr_set_error_notifier, + .handle_notify_pending = gk20a_gr_handle_notify_pending, }, .fb = { .reset = gp106_fb_reset, diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 38facd974..65fdf7140 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c @@ -342,6 +342,7 @@ static const struct gpu_ops gp10b_ops = { .dump_ctxsw_stats = gr_gp10b_dump_ctxsw_stats, .fecs_host_int_enable = gr_gk20a_fecs_host_int_enable, .set_error_notifier = gk20a_gr_set_error_notifier, + .handle_notify_pending = gk20a_gr_handle_notify_pending, }, .fb = { .reset = fb_gk20a_reset, diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index 449c3f9c4..6598d7f6f 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c @@ -427,6 +427,7 @@ static const struct gpu_ops gv100_ops = { .fecs_host_int_enable = gr_gv11b_fecs_host_int_enable, .handle_ssync_hww = gr_gv11b_handle_ssync_hww, .set_error_notifier = gk20a_gr_set_error_notifier, + .handle_notify_pending = gk20a_gr_handle_notify_pending, }, .fb = { .reset = gv100_fb_reset, diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 7ae8898b6..700dc7fc4 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -394,6 +394,7 @@ static const struct gpu_ops gv11b_ops = { .fecs_host_int_enable = gr_gv11b_fecs_host_int_enable, .handle_ssync_hww = gr_gv11b_handle_ssync_hww, .set_error_notifier = gk20a_gr_set_error_notifier, + .handle_notify_pending = gk20a_gr_handle_notify_pending, }, .fb = { .reset = gv11b_fb_reset,