From a23e574de0502c1304591547518390a5d18a9c49 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Wed, 25 Jan 2023 10:18:29 -0800 Subject: [PATCH] gpu: nvgpu: vf: init syncpt mem Since gmmu map is moved to VF, the syncpt mem map is also on VF clients. Jira GVSCI-15733 Change-Id: Iaf68070da860616f5301a822ce98581b8a1a6629 Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2863445 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert Reviewed-by: svcacv Reviewed-by: Prathap Kumar Valsan GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/init/nvgpu_init.c | 2 +- drivers/gpu/nvgpu/common/vgpu/init/init_vgpu.c | 8 ++++++++ drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h | 10 +++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index 1a02b5bf1..41b137912 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -653,7 +653,7 @@ static int nvgpu_init_xve_set_speed(struct gk20a *g) return 0; } -static int nvgpu_init_syncpt_mem(struct gk20a *g) +int nvgpu_init_syncpt_mem(struct gk20a *g) { #if defined(CONFIG_TEGRA_GK20A_NVHOST) int err; diff --git a/drivers/gpu/nvgpu/common/vgpu/init/init_vgpu.c b/drivers/gpu/nvgpu/common/vgpu/init/init_vgpu.c index 7ba846bc9..3a94a2f19 100644 --- a/drivers/gpu/nvgpu/common/vgpu/init/init_vgpu.c +++ b/drivers/gpu/nvgpu/common/vgpu/init/init_vgpu.c @@ -298,5 +298,13 @@ int vgpu_finalize_poweron_common(struct gk20a *g) return err; } + if (nvgpu_is_vf(g)) { + err = nvgpu_init_syncpt_mem(g); + if (err != 0) { + nvgpu_err(g, "nvgpu_init_syncpt_mem failed"); + return err; + } + } + return 0; } diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h index 5e0c11b9d..c7afacde0 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -394,4 +394,12 @@ void gk20a_idle(struct gk20a *g); */ bool is_nvgpu_gpu_state_valid(struct gk20a *g); +/** + * @brief Init syncpt mem + * + * @param g [in] The GPU + * @return 0 in case of success + */ +int nvgpu_init_syncpt_mem(struct gk20a *g); + #endif /* NVGPU_INIT_H */