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/platform_gk20a.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/platform_gk20a.h') 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