gpu: nvpgu: Move GR IDLE timeout definition to header

GR IDLE timeout is defined as Kconfig. Instead of that introduce a
new header file defaults.h which encapsulates any generic defaults
we use in nvgpu, and move the definition there.

Change-Id: I78ff1d2790d7ee3dff6df42bbd11cf683a85bf79
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1612650
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2017-11-29 15:53:24 -08:00
committed by mobile promotions
parent ee0bc391e0
commit 5121bd4b6f
4 changed files with 35 additions and 10 deletions

View File

@@ -5,13 +5,6 @@ config GK20A
Choose this option if you have an SoC with integrated Choose this option if you have an SoC with integrated
Nvidia GPU IP. Nvidia GPU IP.
config GK20A_DEFAULT_TIMEOUT
depends on GK20A
int "Default timeout for submits"
default 3000
help
Default timeout for jobs in milliseconds. Set to zero for no timeout.
config GK20A_PMU config GK20A_PMU
bool "Support GK20A PMU" bool "Support GK20A PMU"
depends on GK20A depends on GK20A

View File

@@ -18,6 +18,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <uapi/linux/nvgpu.h> #include <uapi/linux/nvgpu.h>
#include <nvgpu/defaults.h>
#include <nvgpu/kmem.h> #include <nvgpu/kmem.h>
#include <nvgpu/nvgpu_common.h> #include <nvgpu/nvgpu_common.h>
#include <nvgpu/soc.h> #include <nvgpu/soc.h>
@@ -88,7 +89,7 @@ static void nvgpu_init_timeout(struct gk20a *g)
{ {
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g));
g->gr_idle_timeout_default = CONFIG_GK20A_DEFAULT_TIMEOUT; g->gr_idle_timeout_default = NVGPU_DEFAULT_GR_IDLE_TIMEOUT;
if (nvgpu_platform_is_silicon(g)) if (nvgpu_platform_is_silicon(g))
g->timeouts_enabled = true; g->timeouts_enabled = true;
else if (nvgpu_platform_is_fpga(g)) { else if (nvgpu_platform_is_fpga(g)) {

View File

@@ -31,6 +31,7 @@
#include <nvgpu/bus.h> #include <nvgpu/bus.h>
#include <nvgpu/soc.h> #include <nvgpu/soc.h>
#include <nvgpu/ctxsw_trace.h> #include <nvgpu/ctxsw_trace.h>
#include <nvgpu/defaults.h>
#include "vgpu.h" #include "vgpu.h"
#include "fecs_trace_vgpu.h" #include "fecs_trace_vgpu.h"
@@ -750,8 +751,7 @@ int vgpu_probe(struct platform_device *pdev)
dev->dma_parms = &l->dma_parms; dev->dma_parms = &l->dma_parms;
dma_set_max_seg_size(dev, UINT_MAX); dma_set_max_seg_size(dev, UINT_MAX);
gk20a->gr_idle_timeout_default = gk20a->gr_idle_timeout_default = NVGPU_DEFAULT_GR_IDLE_TIMEOUT;
CONFIG_GK20A_DEFAULT_TIMEOUT;
gk20a->timeouts_enabled = true; gk20a->timeouts_enabled = true;
vgpu_create_sysfs(dev); vgpu_create_sysfs(dev);

View File

@@ -0,0 +1,31 @@
/*
* Copyright (c) 2017, 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_DEFAULTS_H__
#define __NVGPU_DEFAULTS_H__
/*
* Default timeout used for channel watchdog and ctxsw timeout.
*/
#define NVGPU_DEFAULT_GR_IDLE_TIMEOUT 3000
#endif