summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2017-01-25 07:35:49 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-27 16:54:41 -0500
commited220567798156aee74291044a6b2d9586cdee71 (patch)
tree254f64b828793606039a9b0738e5d7277046824a /drivers
parent88ce7a98c8321747154020c4f173cfe05a3b1149 (diff)
gpu: nvgpu: add disable_syncpoints debugfs node
To test semaphore-related bugs with igpus, add a debugfs node called "disable_syncpoints" to override the "has_syncpoints" platform flag. This makes job synchronization use semaphores, for example. NVGPU_GPU_FLAGS_HAS_SYNCPOINTS is still reported in gpu characteristics if the platform supports that, because it is filled in during boot. Jira NVGPU-18 Change-Id: I58c815f896a6054df472f571012c239f1478bf07 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1293972 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/debug_gk20a.c5
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a.h11
2 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
index 609ddf72..37ba720a 100644
--- a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * drivers/video/tegra/host/t20/debug_gk20a.c 2 * drivers/video/tegra/host/t20/debug_gk20a.c
3 * 3 *
4 * Copyright (C) 2011-2016 NVIDIA Corporation. All rights reserved. 4 * Copyright (C) 2011-2017 NVIDIA Corporation. All rights reserved.
5 * 5 *
6 * This software is licensed under the terms of the GNU General Public 6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and 7 * License version 2, as published by the Free Software Foundation, and
@@ -412,6 +412,9 @@ void gk20a_debug_init(struct device *dev, const char *debugfs_symlink)
412 debugfs_create_u32("ch_wdt_timeout_ms", S_IRUGO|S_IWUSR, 412 debugfs_create_u32("ch_wdt_timeout_ms", S_IRUGO|S_IWUSR,
413 platform->debugfs, &platform->ch_wdt_timeout_ms); 413 platform->debugfs, &platform->ch_wdt_timeout_ms);
414 414
415 debugfs_create_bool("disable_syncpoints", S_IRUGO|S_IWUSR,
416 platform->debugfs, &platform->disable_syncpoints);
417
415#if defined(GK20A_DEBUG) 418#if defined(GK20A_DEBUG)
416 debugfs_create_u32("dbg_mask", S_IRUGO|S_IWUSR, 419 debugfs_create_u32("dbg_mask", S_IRUGO|S_IWUSR,
417 platform->debugfs, &gk20a_dbg_mask); 420 platform->debugfs, &gk20a_dbg_mask);
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
index 6966394f..e71dbf32 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A Platform (SoC) Interface 2 * GK20A Platform (SoC) Interface
3 * 3 *
4 * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -18,6 +18,7 @@
18 18
19#include <linux/device.h> 19#include <linux/device.h>
20#include <linux/dma-attrs.h> 20#include <linux/dma-attrs.h>
21#include <linux/version.h>
21 22
22#define GK20A_CLKS_MAX 4 23#define GK20A_CLKS_MAX 4
23 24
@@ -54,6 +55,12 @@ struct gk20a_platform {
54 55
55 /* Should be populated at probe. */ 56 /* Should be populated at probe. */
56 bool has_syncpoints; 57 bool has_syncpoints;
58 /* Debugfs knob for forcing syncpt support off in runtime. */
59#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
60 u32 disable_syncpoints;
61#else
62 bool disable_syncpoints;
63#endif
57 64
58 /* channel limit after which to start aggressive sync destroy */ 65 /* channel limit after which to start aggressive sync destroy */
59 unsigned int aggressive_sync_destroy_thresh; 66 unsigned int aggressive_sync_destroy_thresh;
@@ -265,7 +272,7 @@ extern struct gk20a_platform vgpu_tegra_platform;
265static inline bool gk20a_platform_has_syncpoints(struct device *dev) 272static inline bool gk20a_platform_has_syncpoints(struct device *dev)
266{ 273{
267 struct gk20a_platform *p = dev_get_drvdata(dev); 274 struct gk20a_platform *p = dev_get_drvdata(dev);
268 return p->has_syncpoints; 275 return p->has_syncpoints && !p->disable_syncpoints;
269} 276}
270 277
271int gk20a_tegra_busy(struct device *dev); 278int gk20a_tegra_busy(struct device *dev);