gpu: nvgpu: add NVGPU_SUPPORT_VPR check for vpr_resize

VPR resize requires GPU to be reset (idle/unidle).
Allow GPU idle/unidle only when NVGPU_SUPPORT_VPR is true.

Bug 3122410
Bug 3144940

Change-Id: I08fb26a0d901922ee78c379982446616a880b9b3
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2427470
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Vedashree Vidwans <vvidwans@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Seema Khowala
2020-10-13 14:52:24 -07:00
committed by Alex Waterman
parent 842dec2470
commit 04de14215b
3 changed files with 15 additions and 5 deletions

View File

@@ -672,6 +672,11 @@ static inline u32 nvgpu_get_poll_timeout(struct gk20a *g)
/** IO Resource in the device tree for SIM mem */ /** IO Resource in the device tree for SIM mem */
#define GK20A_SIM_IORESOURCE_MEM 2U #define GK20A_SIM_IORESOURCE_MEM 2U
#ifdef CONFIG_NVGPU_VPR
int gk20a_do_idle(void *_g);
int gk20a_do_unidle(void *_g);
#endif
#ifdef CONFIG_PM #ifdef CONFIG_PM
int gk20a_do_idle_impl(struct gk20a *g, bool force_reset); int gk20a_do_idle_impl(struct gk20a *g, bool force_reset);
int gk20a_do_unidle_impl(struct gk20a *g); int gk20a_do_unidle_impl(struct gk20a *g);

View File

@@ -884,7 +884,7 @@ fail_timeout:
* *
* In success, this call MUST be balanced by caller with gk20a_do_unidle() * In success, this call MUST be balanced by caller with gk20a_do_unidle()
*/ */
static int gk20a_do_idle(void *_g) int gk20a_do_idle(void *_g)
{ {
struct gk20a *g = (struct gk20a *)_g; struct gk20a *g = (struct gk20a *)_g;
@@ -934,7 +934,7 @@ int gk20a_do_unidle_impl(struct gk20a *g)
/** /**
* gk20a_do_unidle() - wrap up for gk20a_do_unidle_impl() * gk20a_do_unidle() - wrap up for gk20a_do_unidle_impl()
*/ */
static int gk20a_do_unidle(void *_g) int gk20a_do_unidle(void *_g)
{ {
struct gk20a *g = (struct gk20a *)_g; struct gk20a *g = (struct gk20a *)_g;
@@ -998,7 +998,9 @@ void gk20a_remove_support(struct gk20a *g)
struct sim_nvgpu_linux *sim_linux; struct sim_nvgpu_linux *sim_linux;
#ifdef CONFIG_NVGPU_VPR #ifdef CONFIG_NVGPU_VPR
if (nvgpu_is_enabled(g, NVGPU_SUPPORT_VPR)) {
tegra_unregister_idle_unidle(gk20a_do_idle); tegra_unregister_idle_unidle(gk20a_do_idle);
}
#endif #endif
#ifdef CONFIG_NVGPU_DEBUGGER #ifdef CONFIG_NVGPU_DEBUGGER

View File

@@ -24,7 +24,7 @@
#if defined(CONFIG_TEGRA_DVFS) #if defined(CONFIG_TEGRA_DVFS)
#include <linux/tegra_soctherm.h> #include <linux/tegra_soctherm.h>
#endif #endif
#ifdef CONFIG_NVGPU_TEGRA_FUSE #if defined(CONFIG_NVGPU_TEGRA_FUSE) || defined(CONFIG_NVGPU_VPR)
#include <linux/platform/tegra/common.h> #include <linux/platform/tegra/common.h>
#endif #endif
@@ -662,6 +662,7 @@ int gk20a_tegra_init_secure_alloc(struct gk20a_platform *platform)
/* VPR is not supported on pre-silicon platforms - Jira NVGPU-5302 */ /* VPR is not supported on pre-silicon platforms - Jira NVGPU-5302 */
if (!tegra_platform_is_silicon()) { if (!tegra_platform_is_silicon()) {
tegra_unregister_idle_unidle(gk20a_do_idle);
nvgpu_log_info(g, "VPR is not supported on pre-si platform"); nvgpu_log_info(g, "VPR is not supported on pre-si platform");
return 0; return 0;
} }
@@ -673,8 +674,10 @@ int gk20a_tegra_init_secure_alloc(struct gk20a_platform *platform)
GFP_KERNEL, DMA_ATTR_NO_KERNEL_MAPPING); GFP_KERNEL, DMA_ATTR_NO_KERNEL_MAPPING);
/* Some platforms disable VPR. In that case VPR allocations always /* Some platforms disable VPR. In that case VPR allocations always
* fail. Just disable VPR usage in nvgpu in that case. */ * fail. Just disable VPR usage in nvgpu in that case. */
if (dma_mapping_error(&tegra_vpr_dev, iova)) if (dma_mapping_error(&tegra_vpr_dev, iova)) {
tegra_unregister_idle_unidle(gk20a_do_idle);
return 0; return 0;
}
secure_buffer->size = platform->secure_buffer_size; secure_buffer->size = platform->secure_buffer_size;
secure_buffer->phys = iova; secure_buffer->phys = iova;