summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/module.c
diff options
context:
space:
mode:
authorDebarshi Dutta <ddutta@nvidia.com>2018-03-23 06:02:27 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-04-23 00:04:48 -0400
commitd0e4dfd6efd651abc431aba9cfae5907638f8172 (patch)
tree1a412eaa4636ff2e2862c1623bad3a5ea6883d4e /drivers/gpu/nvgpu/common/linux/module.c
parentc918c42a4a3651f757c6966aead4b07eb4b56697 (diff)
gpu: nvgpu: sync_framework cleanups
This patch deals with cleanups meant to make things simpler for the upcoming os abstraction patches for the sync framework. This patch causes some substantial changes which are listed out as follows. 1) sync_timeline is moved out of gk20a_fence into struct nvgpu_channel_linux. New function pointers are created to facilitate os independent methods for enabling/disabling timeline and are now named as os_fence_framework. These function pointers are located in the struct os_channel under struct gk20a. 2) construction of the channel_sync require nvgpu_finalize_poweron_linux() to be invoked before invocations to nvgpu_init_mm_ce_context(). Hence, these methods are now moved away from gk20a_finalize_poweron() and invoked after nvgpu_finalize_poweron_linux(). 3) sync_fence creation is now delinked from fence construction and move to the channel_sync_gk20a's channel_incr methods. These sync_fences are mainly associated with post_fences. 4) In case userspace requires the sync_fences to be constructed, we try to obtain an fd before the gk20a_channel_submit_gpfifo() instead of trying to do that later. This is used to avoid potential after effects of duplicate work submission due to failure to obtain an unused fd. JIRA NVGPU-66 Change-Id: I42a3e4e2e692a113b1b36d2b48ab107ae4444dfa Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1678400 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/module.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index b9c9554b..81b3db82 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -40,6 +40,7 @@
40#include <nvgpu/enabled.h> 40#include <nvgpu/enabled.h>
41#include <nvgpu/debug.h> 41#include <nvgpu/debug.h>
42#include <nvgpu/ctxsw_trace.h> 42#include <nvgpu/ctxsw_trace.h>
43#include <nvgpu/vidmem.h>
43 44
44#include "platform_gk20a.h" 45#include "platform_gk20a.h"
45#include "sysfs.h" 46#include "sysfs.h"
@@ -252,13 +253,22 @@ int gk20a_pm_finalize_poweron(struct device *dev)
252 return err; 253 return err;
253 254
254 err = gk20a_finalize_poweron(g); 255 err = gk20a_finalize_poweron(g);
255 set_user_nice(current, nice_value); 256 if (err) {
256 if (err) 257 set_user_nice(current, nice_value);
257 goto done; 258 goto done;
259 }
258 260
259 err = nvgpu_finalize_poweron_linux(l); 261 err = nvgpu_finalize_poweron_linux(l);
260 if (err) 262 if (err) {
263 set_user_nice(current, nice_value);
261 goto done; 264 goto done;
265 }
266
267 nvgpu_init_mm_ce_context(g);
268
269 nvgpu_vidmem_thread_unpause(&g->mm);
270
271 set_user_nice(current, nice_value);
262 272
263 /* Initialise scaling: it will initialize scaling drive only once */ 273 /* Initialise scaling: it will initialize scaling drive only once */
264 if (IS_ENABLED(CONFIG_GK20A_DEVFREQ) && 274 if (IS_ENABLED(CONFIG_GK20A_DEVFREQ) &&