From ca95adb2d4e51431de2f8fbe252bade55ba0ed46 Mon Sep 17 00:00:00 2001 From: Aparna Das Date: Thu, 15 Feb 2018 13:55:47 -0800 Subject: gpu: nvgpu: add hal op to handle semaphore pending The vserver variant for gr handle semaphore pending needs different functionality to send interrupt to VM. Add HAL operation to allow overriding vserver usecase. Jira VQRM-2982 Change-Id: I5fee5a491c6e54344f9da477eaf5881c50335bbc Signed-off-by: Aparna Das Reviewed-on: https://git-master.nvidia.com/r/1658298 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 2 ++ drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 6 +++--- 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, 12 insertions(+), 3 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 178c1200..6b93cb8d 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -447,6 +447,8 @@ struct gpu_ops { struct gr_gk20a_isr_data *isr_data, u32 error_notifier); int (*handle_notify_pending)(struct gk20a *g, struct gr_gk20a_isr_data *isr_data); + int (*handle_semaphore_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 068eb070..8b07619d 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -5267,8 +5267,8 @@ static int gk20a_gr_handle_firmware_method(struct gk20a *g, return -EINVAL; } -static int gk20a_gr_handle_semaphore_pending(struct gk20a *g, - struct gr_gk20a_isr_data *isr_data) +int gk20a_gr_handle_semaphore_pending(struct gk20a *g, + struct gr_gk20a_isr_data *isr_data) { struct fifo_gk20a *f = &g->fifo; struct channel_gk20a *ch = &f->channel[isr_data->chid]; @@ -5896,7 +5896,7 @@ int gk20a_gr_isr(struct gk20a *g) } if (gr_intr & gr_intr_semaphore_pending_f()) { - gk20a_gr_handle_semaphore_pending(g, &isr_data); + g->ops.gr.handle_semaphore_pending(g, &isr_data); gk20a_writel(g, gr_intr_r(), gr_intr_semaphore_reset_f()); gr_intr &= ~gr_intr_semaphore_pending_f(); diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index fff22f29..e4eb6c4a 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -808,4 +808,6 @@ int gr_gk20a_fecs_ctx_bind_channel(struct gk20a *g, struct channel_gk20a *c); u32 gk20a_init_sw_bundle(struct gk20a *g); int gr_gk20a_fecs_ctx_image_save(struct channel_gk20a *c, u32 save_type); +int gk20a_gr_handle_semaphore_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 9c3cc63e..ea087e92 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c @@ -313,6 +313,7 @@ static const struct gpu_ops gm20b_ops = { .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, + .handle_semaphore_pending = gk20a_gr_handle_semaphore_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 75c9d336..e3d5556f 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -375,6 +375,7 @@ static const struct gpu_ops gp106_ops = { .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, + .handle_semaphore_pending = gk20a_gr_handle_semaphore_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 137980a9..dd914ed4 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c @@ -343,6 +343,7 @@ static const struct gpu_ops gp10b_ops = { .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, + .handle_semaphore_pending = gk20a_gr_handle_semaphore_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 7e1b6a3f..00f5bcce 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c @@ -428,6 +428,7 @@ static const struct gpu_ops gv100_ops = { .handle_ssync_hww = gr_gv11b_handle_ssync_hww, .set_error_notifier = gk20a_gr_set_error_notifier, .handle_notify_pending = gk20a_gr_handle_notify_pending, + .handle_semaphore_pending = gk20a_gr_handle_semaphore_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 11d710bf..2443a4b1 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -395,6 +395,7 @@ static const struct gpu_ops gv11b_ops = { .handle_ssync_hww = gr_gv11b_handle_ssync_hww, .set_error_notifier = gk20a_gr_set_error_notifier, .handle_notify_pending = gk20a_gr_handle_notify_pending, + .handle_semaphore_pending = gk20a_gr_handle_semaphore_pending, }, .fb = { .reset = gv11b_fb_reset, -- cgit v1.2.2