gpu: nvgpu: use vpr resize enabled API

This patch adds nvgpu API in linux and posix to query vpr resize.
The new API nvgpu_is_vpr_resize_enabled() is used in
nvgpu_submit_channel_gpfifo().
Previously, if non-deterministic channel has timeout disabled and
GPU cannot railgate on some platform, then channel doesn't power ref
count and results in video freeze. To resolve non-determinstic channel
job tracking needs to be enabled if vpr resize is supported or if GPU
can railgate.

Bug 200532122

Change-Id: Icfbff6253762b195b2f5955749343974b1a7a269
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2171093
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Vedashree Vidwans
2019-08-12 11:58:59 -07:00
committed by mobile promotions
parent 5e88e7d931
commit 7bc3cdcf95
9 changed files with 89 additions and 5 deletions

View File

@@ -126,3 +126,7 @@ os_sched:
nvhost: nvhost:
safe: yes safe: yes
sources: [ include/nvgpu/nvhost.h ] sources: [ include/nvgpu/nvhost.h ]
vpr:
safe: no
sources: [ include/nvgpu/vpr.h ]

View File

@@ -16,6 +16,9 @@ bsearch:
channel: channel:
sources: [ os/linux/linux-channel.c, os/linux/channel.h ] sources: [ os/linux/linux-channel.c, os/linux/channel.h ]
vpr:
sources: [ os/linux/vpr.c ]
clk: clk:
sources: [ os/linux/clk.c, os/linux/clk.h ] sources: [ os/linux/clk.c, os/linux/clk.h ]

View File

@@ -33,7 +33,8 @@ all:
os/posix/posix-vgpu.c, os/posix/posix-vgpu.c,
os/posix/posix-vidmem.c, os/posix/posix-vidmem.c,
os/posix/fecs_trace_posix.c, os/posix/fecs_trace_posix.c,
os/posix/stubs.c ] os/posix/stubs.c,
os/posix/posix-vpr.c ]
headers: headers:
safe: no safe: no

View File

@@ -355,7 +355,8 @@ nvgpu-y += \
os/linux/os_ops_tu104.o \ os/linux/os_ops_tu104.o \
os/linux/bsearch.o \ os/linux/bsearch.o \
os/linux/sdl/sdl_stub.o \ os/linux/sdl/sdl_stub.o \
os/linux/dmabuf_vidmem.o os/linux/dmabuf_vidmem.o \
os/linux/vpr.o
nvgpu-$(CONFIG_DEBUG_FS) += \ nvgpu-$(CONFIG_DEBUG_FS) += \
os/linux/debug.o \ os/linux/debug.o \

View File

@@ -37,7 +37,8 @@ srcs += os/posix/nvgpu.c \
os/posix/stubs.c \ os/posix/stubs.c \
os/posix/posix-nvhost.c \ os/posix/posix-nvhost.c \
os/posix/posix-vgpu.c \ os/posix/posix-vgpu.c \
os/posix/posix-dt.c os/posix/posix-dt.c \
os/posix/posix-vpr.c
ifdef CONFIG_NVGPU_FECS_TRACE ifdef CONFIG_NVGPU_FECS_TRACE
srcs += os/posix/fecs_trace_posix.c srcs += os/posix/fecs_trace_posix.c

View File

@@ -30,6 +30,7 @@
#include <nvgpu/bug.h> #include <nvgpu/bug.h>
#include <nvgpu/fence.h> #include <nvgpu/fence.h>
#include <nvgpu/profile.h> #include <nvgpu/profile.h>
#include <nvgpu/vpr.h>
#ifdef CONFIG_NVGPU_TRACE #ifdef CONFIG_NVGPU_TRACE
#include <trace/events/gk20a.h> #include <trace/events/gk20a.h>
@@ -405,6 +406,7 @@ static int nvgpu_submit_channel_gpfifo(struct nvgpu_channel *c,
* - pre- or post-fence functionality * - pre- or post-fence functionality
* - channel wdt * - channel wdt
* - GPU rail-gating with non-deterministic channels * - GPU rail-gating with non-deterministic channels
* - VPR resize enabled with non-deterministic channels
* - buffer refcounting * - buffer refcounting
* *
* If none of the conditions are met, then job tracking is not * If none of the conditions are met, then job tracking is not
@@ -413,8 +415,9 @@ static int nvgpu_submit_channel_gpfifo(struct nvgpu_channel *c,
*/ */
need_job_tracking = (flag_fence_wait || need_job_tracking = (flag_fence_wait ||
flag_fence_get || flag_fence_get ||
(nvgpu_is_enabled(g, NVGPU_CAN_RAILGATE) ((nvgpu_is_enabled(g, NVGPU_CAN_RAILGATE) ||
&& !c->deterministic) || nvgpu_is_vpr_resize_enabled()) &&
!c->deterministic) ||
!skip_buffer_refcounting); !skip_buffer_refcounting);
#ifdef CONFIG_NVGPU_CHANNEL_WDT #ifdef CONFIG_NVGPU_CHANNEL_WDT

View File

@@ -0,0 +1,30 @@
/*
* Copyright (c) 2019, 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"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef NVGPU_VPR_H
#define NVGPU_VPR_H
#include <nvgpu/types.h>
bool nvgpu_is_vpr_resize_enabled(void);
#endif /* NVGPU_VPR_H */

View File

@@ -0,0 +1,22 @@
/*
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#include <nvgpu/vpr.h>
#include <linux/init.h>
#include <linux/platform/tegra/common.h>
bool nvgpu_is_vpr_resize_enabled(void)
{
return tegra_is_vpr_resize_enabled();
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#include <nvgpu/vpr.h>
bool nvgpu_is_vpr_resize_enabled(void)
{
return false;
}