summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-10-05 20:22:41 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-20 22:03:57 -0400
commite26ce10cc6b59314ccf5931a8c5b46a9e57b085a (patch)
tree2bcafc57fcb8679c09195ba08ccf7a6fdfc91fe1 /drivers/gpu/nvgpu/gk20a/mm_gk20a.c
parent8c5ea40ccaad022401e45e61d5b6ff3354ffa413 (diff)
gpu: nvgpu: Convert VIDMEM work_struct to thread
Convert the work_struct used by the vidmem background clearing to a thread to make it more cross platform. The thread waits on a condition variable to determine when work needs to be done. The signal comes from the DMA API when it enqueues a new nvgpu_mem that needs clearing. Add logic for handling suspend: the CE cannot be accessed while the GPU is suspended. As such the background thread must be paused while the GPU is suspended and the CE is not available. Several other changes were also made: o Move the code that enqueues a nvgpu_mem from the DMA API code to a function in the VIDMEM code. o Move nvgpu_vidmem_get_pending_alloc() to the Linux specific code as this function is only used there. It's a trivial function that QNX can easily implement as well. o Remove the was_empty logic from the enqueue. Now just always signal the condition variable when anew nvgpu_mem comes in. o Move CE suspend to after MM suspend. JIRA NVGPU-30 JIRA NVGPU-138 Change-Id: Ie9286ae5a127c3fced86dfb9794e7d81eab0491c Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1574498 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 687951a9..67ab307f 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -978,9 +978,7 @@ int gk20a_mm_suspend(struct gk20a *g)
978{ 978{
979 gk20a_dbg_fn(""); 979 gk20a_dbg_fn("");
980 980
981#if defined(CONFIG_GK20A_VIDMEM) 981 nvgpu_vidmem_thread_pause_sync(&g->mm);
982 cancel_work_sync(&g->mm.vidmem.clear_mem_worker);
983#endif
984 982
985 g->ops.mm.cbc_clean(g); 983 g->ops.mm.cbc_clean(g);
986 g->ops.mm.l2_flush(g, false); 984 g->ops.mm.l2_flush(g, false);