From 2077df9b1a86646c0f5efd1c9f8cee2b483da588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konsta=20H=C3=B6ltt=C3=A4?= Date: Thu, 14 May 2020 15:19:05 +0300 Subject: [PATCH] gpu: nvgpu: use set_syncpt only with nvhost MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nvgpu_channel_set_syncpt() is not useful if nvhost and thus syncpts are missing and semaphores are used for synchronization. Require CONFIG_TEGRA_GK20A_NVHOST to be set for the set_syncpt hal. Jira NVGPU-5496 Change-Id: Ief8b4a0fb29af631817aba55c04181b1a360ce56 Signed-off-by: Konsta Hölttä Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2344064 Reviewed-by: automaticguardword Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert Reviewed-by: Alex Waterman Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fifo/channel.c | 2 ++ drivers/gpu/nvgpu/hal/init/hal_gp10b.c | 2 +- drivers/gpu/nvgpu/include/nvgpu/channel.h | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index 9ec12c186..728a1e45d 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -249,6 +249,7 @@ bool nvgpu_channel_is_prealloc_enabled(struct nvgpu_channel *c) #endif } +#ifdef CONFIG_TEGRA_GK20A_NVHOST int nvgpu_channel_set_syncpt(struct nvgpu_channel *ch) { struct gk20a *g = ch->g; @@ -302,6 +303,7 @@ out: } return err; } +#endif static int channel_setup_kernelmode(struct nvgpu_channel *c, struct nvgpu_setup_bind_args *args) diff --git a/drivers/gpu/nvgpu/hal/init/hal_gp10b.c b/drivers/gpu/nvgpu/hal/init/hal_gp10b.c index 4227ba27b..f19089921 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gp10b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gp10b.c @@ -913,7 +913,7 @@ static const struct gpu_ops gp10b_ops = { .count = gm20b_channel_count, .read_state = gk20a_channel_read_state, .force_ctx_reload = gm20b_channel_force_ctx_reload, -#ifdef CONFIG_NVGPU_KERNEL_MODE_SUBMIT +#if defined(CONFIG_NVGPU_KERNEL_MODE_SUBMIT) && defined(CONFIG_TEGRA_GK20A_NVHOST) .set_syncpt = nvgpu_channel_set_syncpt, #endif .abort_clean_up = nvgpu_channel_abort_clean_up, diff --git a/drivers/gpu/nvgpu/include/nvgpu/channel.h b/drivers/gpu/nvgpu/include/nvgpu/channel.h index bb9f5a0d0..f2b13287d 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/channel.h +++ b/drivers/gpu/nvgpu/include/nvgpu/channel.h @@ -609,7 +609,9 @@ int nvgpu_submit_channel_gpfifo_kernel(struct nvgpu_channel *c, u32 flags, struct nvgpu_channel_fence *fence, struct nvgpu_fence_type **fence_out); +#ifdef CONFIG_TEGRA_GK20A_NVHOST int nvgpu_channel_set_syncpt(struct nvgpu_channel *ch); +#endif bool nvgpu_channel_is_prealloc_enabled(struct nvgpu_channel *c); bool nvgpu_channel_update_and_check_ctxsw_timeout(struct nvgpu_channel *ch,