From d436ad67b60eef68c7d5551b539490f8efb24387 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Mon, 19 Mar 2018 14:45:14 -0700 Subject: gpu: nvgpu: add gops.fifo.channel_suspend/channel_resume RM Server acts differently for channel suspend/resume. Jira VQRM-3058 Change-Id: If41e3099164654db448d1157fd7f51dd00c5e201 Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1679707 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.c | 11 +++++++---- drivers/gpu/nvgpu/gk20a/gk20a.h | 2 ++ drivers/gpu/nvgpu/gm20b/hal_gm20b.c | 2 ++ drivers/gpu/nvgpu/gp106/hal_gp106.c | 2 ++ drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 2 ++ drivers/gpu/nvgpu/gv100/hal_gv100.c | 2 ++ drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 2 ++ drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c | 2 ++ drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c | 2 ++ 9 files changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 0206c915..64ae4401 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -91,9 +91,11 @@ int gk20a_prepare_poweroff(struct gk20a *g) gk20a_dbg_fn(""); - ret = gk20a_channel_suspend(g); - if (ret) - return ret; + if (g->ops.fifo.channel_suspend) { + ret = g->ops.fifo.channel_suspend(g); + if (ret) + return ret; + } /* disable elpg before gr or fifo suspend */ if (g->ops.pmu.is_pmu_supported(g)) @@ -330,7 +332,8 @@ int gk20a_finalize_poweron(struct gk20a *g) } #endif - gk20a_channel_resume(g); + if (g->ops.fifo.channel_resume) + g->ops.fifo.channel_resume(g); nvgpu_init_mm_ce_context(g); diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 76413600..c7653133 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -633,6 +633,8 @@ struct gpu_ops { bool *verbose, u32 *ms); bool (*check_ch_ctxsw_timeout)(struct channel_gk20a *ch, bool *verbose, u32 *ms); + int (*channel_suspend)(struct gk20a *g); + int (*channel_resume)(struct gk20a *g); #ifdef CONFIG_TEGRA_GK20A_NVHOST int (*alloc_syncpt_buf)(struct channel_gk20a *c, u32 syncpt_id, struct nvgpu_mem *syncpt_buf); diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index fa493192..b41e07f9 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c @@ -441,6 +441,8 @@ static const struct gpu_ops gm20b_ops = { .ch_abort_clean_up = gk20a_channel_abort_clean_up, .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, + .channel_suspend = gk20a_channel_suspend, + .channel_resume = gk20a_channel_resume, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf, .free_syncpt_buf = gk20a_fifo_free_syncpt_buf, diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 892e71f7..2f3c1a5e 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -502,6 +502,8 @@ static const struct gpu_ops gp106_ops = { .ch_abort_clean_up = gk20a_channel_abort_clean_up, .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, + .channel_suspend = gk20a_channel_suspend, + .channel_resume = gk20a_channel_resume, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf, .free_syncpt_buf = gk20a_fifo_free_syncpt_buf, diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 4db7e557..9238c4d7 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c @@ -473,6 +473,8 @@ static const struct gpu_ops gp10b_ops = { .ch_abort_clean_up = gk20a_channel_abort_clean_up, .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, + .channel_suspend = gk20a_channel_suspend, + .channel_resume = gk20a_channel_resume, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf, .free_syncpt_buf = gk20a_fifo_free_syncpt_buf, diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index f3e25ddd..2f2d278e 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c @@ -514,6 +514,8 @@ static const struct gpu_ops gv100_ops = { .ch_abort_clean_up = gk20a_channel_abort_clean_up, .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, + .channel_suspend = gk20a_channel_suspend, + .channel_resume = gk20a_channel_resume, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = gv11b_fifo_alloc_syncpt_buf, .free_syncpt_buf = gv11b_fifo_free_syncpt_buf, diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index fbf8ad61..67b3adbf 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -531,6 +531,8 @@ static const struct gpu_ops gv11b_ops = { .ch_abort_clean_up = gk20a_channel_abort_clean_up, .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, + .channel_suspend = gk20a_channel_suspend, + .channel_resume = gk20a_channel_resume, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = gv11b_fifo_alloc_syncpt_buf, .free_syncpt_buf = gv11b_fifo_free_syncpt_buf, diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c index 8b8c630d..ab08e09d 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c @@ -347,6 +347,8 @@ static const struct gpu_ops vgpu_gp10b_ops = { .ch_abort_clean_up = gk20a_channel_abort_clean_up, .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, + .channel_suspend = gk20a_channel_suspend, + .channel_resume = gk20a_channel_resume, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf, .free_syncpt_buf = gk20a_fifo_free_syncpt_buf, diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c index 5dbf6779..5e3af9d7 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c @@ -390,6 +390,8 @@ static const struct gpu_ops vgpu_gv11b_ops = { .ch_abort_clean_up = gk20a_channel_abort_clean_up, .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, + .channel_suspend = gk20a_channel_suspend, + .channel_resume = gk20a_channel_resume, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = vgpu_gv11b_fifo_alloc_syncpt_buf, .free_syncpt_buf = gv11b_fifo_free_syncpt_buf, -- cgit v1.2.2