From ed220567798156aee74291044a6b2d9586cdee71 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 25 Jan 2017 14:35:49 +0200 Subject: 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 Reviewed-on: http://git-master/r/1293972 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/debug_gk20a.c | 5 ++++- drivers/gpu/nvgpu/gk20a/platform_gk20a.h | 11 +++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'drivers') 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 @@ /* * drivers/video/tegra/host/t20/debug_gk20a.c * - * Copyright (C) 2011-2016 NVIDIA Corporation. All rights reserved. + * Copyright (C) 2011-2017 NVIDIA Corporation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * 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) debugfs_create_u32("ch_wdt_timeout_ms", S_IRUGO|S_IWUSR, platform->debugfs, &platform->ch_wdt_timeout_ms); + debugfs_create_bool("disable_syncpoints", S_IRUGO|S_IWUSR, + platform->debugfs, &platform->disable_syncpoints); + #if defined(GK20A_DEBUG) debugfs_create_u32("dbg_mask", S_IRUGO|S_IWUSR, 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 @@ /* * GK20A Platform (SoC) Interface * - * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2017, 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, @@ -18,6 +18,7 @@ #include #include +#include #define GK20A_CLKS_MAX 4 @@ -54,6 +55,12 @@ struct gk20a_platform { /* Should be populated at probe. */ bool has_syncpoints; + /* Debugfs knob for forcing syncpt support off in runtime. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) + u32 disable_syncpoints; +#else + bool disable_syncpoints; +#endif /* channel limit after which to start aggressive sync destroy */ unsigned int aggressive_sync_destroy_thresh; @@ -265,7 +272,7 @@ extern struct gk20a_platform vgpu_tegra_platform; static inline bool gk20a_platform_has_syncpoints(struct device *dev) { struct gk20a_platform *p = dev_get_drvdata(dev); - return p->has_syncpoints; + return p->has_syncpoints && !p->disable_syncpoints; } int gk20a_tegra_busy(struct device *dev); -- cgit v1.2.2