summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-11-29 18:53:24 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-12-08 18:53:35 -0500
commit5121bd4b6f2a41b3db045cca7246f9b1832c8648 (patch)
tree68183487f09347b6827e1ae4fa3887ff730d9303
parentee0bc391e047bc11611323fb4d30d0be4389be6b (diff)
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>
-rw-r--r--drivers/gpu/nvgpu/Kconfig7
-rw-r--r--drivers/gpu/nvgpu/common/linux/driver_common.c3
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c4
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/defaults.h31
4 files changed, 35 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/Kconfig b/drivers/gpu/nvgpu/Kconfig
index cab717bb..01744453 100644
--- a/drivers/gpu/nvgpu/Kconfig
+++ b/drivers/gpu/nvgpu/Kconfig
@@ -5,13 +5,6 @@ config GK20A
5 Choose this option if you have an SoC with integrated 5 Choose this option if you have an SoC with integrated
6 Nvidia GPU IP. 6 Nvidia GPU IP.
7 7
8config GK20A_DEFAULT_TIMEOUT
9 depends on GK20A
10 int "Default timeout for submits"
11 default 3000
12 help
13 Default timeout for jobs in milliseconds. Set to zero for no timeout.
14
15config GK20A_PMU 8config GK20A_PMU
16 bool "Support GK20A PMU" 9 bool "Support GK20A PMU"
17 depends on GK20A 10 depends on GK20A
diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c
index 425198d5..51ae18a3 100644
--- a/drivers/gpu/nvgpu/common/linux/driver_common.c
+++ b/drivers/gpu/nvgpu/common/linux/driver_common.c
@@ -18,6 +18,7 @@
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <uapi/linux/nvgpu.h> 19#include <uapi/linux/nvgpu.h>
20 20
21#include <nvgpu/defaults.h>
21#include <nvgpu/kmem.h> 22#include <nvgpu/kmem.h>
22#include <nvgpu/nvgpu_common.h> 23#include <nvgpu/nvgpu_common.h>
23#include <nvgpu/soc.h> 24#include <nvgpu/soc.h>
@@ -88,7 +89,7 @@ static void nvgpu_init_timeout(struct gk20a *g)
88{ 89{
89 struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); 90 struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g));
90 91
91 g->gr_idle_timeout_default = CONFIG_GK20A_DEFAULT_TIMEOUT; 92 g->gr_idle_timeout_default = NVGPU_DEFAULT_GR_IDLE_TIMEOUT;
92 if (nvgpu_platform_is_silicon(g)) 93 if (nvgpu_platform_is_silicon(g))
93 g->timeouts_enabled = true; 94 g->timeouts_enabled = true;
94 else if (nvgpu_platform_is_fpga(g)) { 95 else if (nvgpu_platform_is_fpga(g)) {
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c
index f6c13db1..1ec0bc1c 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c
@@ -31,6 +31,7 @@
31#include <nvgpu/bus.h> 31#include <nvgpu/bus.h>
32#include <nvgpu/soc.h> 32#include <nvgpu/soc.h>
33#include <nvgpu/ctxsw_trace.h> 33#include <nvgpu/ctxsw_trace.h>
34#include <nvgpu/defaults.h>
34 35
35#include "vgpu.h" 36#include "vgpu.h"
36#include "fecs_trace_vgpu.h" 37#include "fecs_trace_vgpu.h"
@@ -750,8 +751,7 @@ int vgpu_probe(struct platform_device *pdev)
750 dev->dma_parms = &l->dma_parms; 751 dev->dma_parms = &l->dma_parms;
751 dma_set_max_seg_size(dev, UINT_MAX); 752 dma_set_max_seg_size(dev, UINT_MAX);
752 753
753 gk20a->gr_idle_timeout_default = 754 gk20a->gr_idle_timeout_default = NVGPU_DEFAULT_GR_IDLE_TIMEOUT;
754 CONFIG_GK20A_DEFAULT_TIMEOUT;
755 gk20a->timeouts_enabled = true; 755 gk20a->timeouts_enabled = true;
756 756
757 vgpu_create_sysfs(dev); 757 vgpu_create_sysfs(dev);
diff --git a/drivers/gpu/nvgpu/include/nvgpu/defaults.h b/drivers/gpu/nvgpu/include/nvgpu/defaults.h
new file mode 100644
index 00000000..2d7a42b1
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/defaults.h
@@ -0,0 +1,31 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef __NVGPU_DEFAULTS_H__
24#define __NVGPU_DEFAULTS_H__
25
26/*
27 * Default timeout used for channel watchdog and ctxsw timeout.
28 */
29#define NVGPU_DEFAULT_GR_IDLE_TIMEOUT 3000
30
31#endif