mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
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:
committed by
Alex Waterman
parent
842dec2470
commit
04de14215b
@@ -672,6 +672,11 @@ static inline u32 nvgpu_get_poll_timeout(struct gk20a *g)
|
||||
/** IO Resource in the device tree for SIM mem */
|
||||
#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
|
||||
int gk20a_do_idle_impl(struct gk20a *g, bool force_reset);
|
||||
int gk20a_do_unidle_impl(struct gk20a *g);
|
||||
|
||||
@@ -884,7 +884,7 @@ fail_timeout:
|
||||
*
|
||||
* 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;
|
||||
|
||||
@@ -934,7 +934,7 @@ int gk20a_do_unidle_impl(struct gk20a *g)
|
||||
/**
|
||||
* 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;
|
||||
|
||||
@@ -998,7 +998,9 @@ void gk20a_remove_support(struct gk20a *g)
|
||||
struct sim_nvgpu_linux *sim_linux;
|
||||
|
||||
#ifdef CONFIG_NVGPU_VPR
|
||||
if (nvgpu_is_enabled(g, NVGPU_SUPPORT_VPR)) {
|
||||
tegra_unregister_idle_unidle(gk20a_do_idle);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NVGPU_DEBUGGER
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#if defined(CONFIG_TEGRA_DVFS)
|
||||
#include <linux/tegra_soctherm.h>
|
||||
#endif
|
||||
#ifdef CONFIG_NVGPU_TEGRA_FUSE
|
||||
#if defined(CONFIG_NVGPU_TEGRA_FUSE) || defined(CONFIG_NVGPU_VPR)
|
||||
#include <linux/platform/tegra/common.h>
|
||||
#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 */
|
||||
if (!tegra_platform_is_silicon()) {
|
||||
tegra_unregister_idle_unidle(gk20a_do_idle);
|
||||
nvgpu_log_info(g, "VPR is not supported on pre-si platform");
|
||||
return 0;
|
||||
}
|
||||
@@ -673,8 +674,10 @@ int gk20a_tegra_init_secure_alloc(struct gk20a_platform *platform)
|
||||
GFP_KERNEL, DMA_ATTR_NO_KERNEL_MAPPING);
|
||||
/* Some platforms disable VPR. In that case VPR allocations always
|
||||
* 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;
|
||||
}
|
||||
|
||||
secure_buffer->size = platform->secure_buffer_size;
|
||||
secure_buffer->phys = iova;
|
||||
|
||||
Reference in New Issue
Block a user