summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-01-12 21:50:34 -0500
committerVarun Colbert <vcolbert@nvidia.com>2017-02-13 21:14:45 -0500
commitaa36d3786aeed6755b9744fed37aad000b582322 (patch)
treed68d71632a01062e00fc2b057c5a0c37dfda4fb8
parentb9194a1c3300e505d22fba97136dd305300397f0 (diff)
gpu: nvgpu: Organize semaphore_gk20a.[ch]
Move semaphore_gk20a.c drivers/gpu/nvgpu/common/ since the semaphore code is common to all chips. Move the semaphore_gk20a.h header file to drivers/gpu/nvgpu/include/nvgpu and rename it to semaphore.h. Also update all places where the header is inluced to use the new path. This revealed an odd location for the enum gk20a_mem_rw_flag. This should be in the mm headers. As a result many places that did not need anything semaphore related had to include the semaphore header file. Fixing this oddity allowed the semaphore include to be removed from many C files that did not need it. Bug 1799159 Change-Id: Ie017219acf34c4c481747323b9f3ac33e76e064c Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1284627 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/Makefile.nvgpu2
-rw-r--r--drivers/gpu/nvgpu/common/semaphore.c (renamed from drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c)12
-rw-r--r--drivers/gpu/nvgpu/gk20a/cde_gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/ce2_gk20a.c3
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c7
-rw-r--r--drivers/gpu/nvgpu/gk20a/debug_gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/gk20a/fence_gk20a.c5
-rw-r--r--drivers/gpu/nvgpu/gk20a/fifo_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.h6
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/sync_gk20a.c11
-rw-r--r--drivers/gpu/nvgpu/gm206/acr_gm206.c1
-rw-r--r--drivers/gpu/nvgpu/gm206/ce_gm206.c3
-rw-r--r--drivers/gpu/nvgpu/gm20b/acr_gm20b.c1
-rw-r--r--drivers/gpu/nvgpu/gp106/acr_gp106.c1
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c1
-rw-r--r--drivers/gpu/nvgpu/gp10b/mm_gp10b.c3
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/semaphore.h (renamed from drivers/gpu/nvgpu/gk20a/semaphore_gk20a.h)14
-rw-r--r--drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c3
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c3
23 files changed, 39 insertions, 56 deletions
diff --git a/drivers/gpu/nvgpu/Makefile.nvgpu b/drivers/gpu/nvgpu/Makefile.nvgpu
index 0f8f5bc1..5c2bbb79 100644
--- a/drivers/gpu/nvgpu/Makefile.nvgpu
+++ b/drivers/gpu/nvgpu/Makefile.nvgpu
@@ -32,6 +32,7 @@ nvgpu-y := \
32 common/mm/page_allocator.o \ 32 common/mm/page_allocator.o \
33 common/mm/lockless_allocator.o \ 33 common/mm/lockless_allocator.o \
34 common/nvgpu_common.o \ 34 common/nvgpu_common.o \
35 common/semaphore.o \
35 gk20a/gk20a.o \ 36 gk20a/gk20a.o \
36 gk20a/sched_gk20a.o \ 37 gk20a/sched_gk20a.o \
37 gk20a/as_gk20a.o \ 38 gk20a/as_gk20a.o \
@@ -48,7 +49,6 @@ nvgpu-y := \
48 gk20a/mm_gk20a.o \ 49 gk20a/mm_gk20a.o \
49 gk20a/pmu_gk20a.o \ 50 gk20a/pmu_gk20a.o \
50 gk20a/priv_ring_gk20a.o \ 51 gk20a/priv_ring_gk20a.o \
51 gk20a/semaphore_gk20a.o \
52 gk20a/fence_gk20a.o \ 52 gk20a/fence_gk20a.o \
53 gk20a/therm_gk20a.o \ 53 gk20a/therm_gk20a.o \
54 gk20a/gr_ctx_gk20a_sim.o \ 54 gk20a/gr_ctx_gk20a_sim.o \
diff --git a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c b/drivers/gpu/nvgpu/common/semaphore.c
index 2038e300..ea4910f1 100644
--- a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c
+++ b/drivers/gpu/nvgpu/common/semaphore.c
@@ -1,9 +1,7 @@
1/* 1/*
2 * drivers/video/tegra/host/gk20a/semaphore_gk20a.c 2 * Nvgpu Semaphores
3 * 3 *
4 * GK20A Semaphores 4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
5 *
6 * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
7 * 5 *
8 * 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
9 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -21,11 +19,7 @@
21#include <linux/highmem.h> 19#include <linux/highmem.h>
22#include <linux/slab.h> 20#include <linux/slab.h>
23 21
24#include <asm/pgtable.h> 22#include <nvgpu/semaphore.h>
25
26#include "gk20a.h"
27#include "mm_gk20a.h"
28#include "semaphore_gk20a.h"
29 23
30#define __lock_sema_sea(s) \ 24#define __lock_sema_sea(s) \
31 do { \ 25 do { \
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
index b4a1f6f4..2a9ad40d 100644
--- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
@@ -34,7 +34,6 @@
34#include "fence_gk20a.h" 34#include "fence_gk20a.h"
35#include "gr_gk20a.h" 35#include "gr_gk20a.h"
36#include "debug_gk20a.h" 36#include "debug_gk20a.h"
37#include "semaphore_gk20a.h"
38 37
39#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h> 38#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h>
40#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> 39#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h>
diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
index 7afed41f..62b0a05e 100644
--- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A Graphics Copy Engine (gr host) 2 * GK20A Graphics Copy Engine (gr host)
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 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,
@@ -28,7 +28,6 @@
28 28
29#include "gk20a.h" 29#include "gk20a.h"
30#include "debug_gk20a.h" 30#include "debug_gk20a.h"
31#include "semaphore_gk20a.h"
32 31
33#include <nvgpu/hw/gk20a/hw_ce2_gk20a.h> 32#include <nvgpu/hw/gk20a/hw_ce2_gk20a.h>
34#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> 33#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h>
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index c8b1c105..3fa6bb25 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -28,13 +28,13 @@
28#include <linux/vmalloc.h> 28#include <linux/vmalloc.h>
29#include <linux/circ_buf.h> 29#include <linux/circ_buf.h>
30 30
31#include "debug_gk20a.h" 31#include <nvgpu/semaphore.h>
32#include "ctxsw_trace_gk20a.h"
33 32
34#include "gk20a.h" 33#include "gk20a.h"
34#include "debug_gk20a.h"
35#include "ctxsw_trace_gk20a.h"
35#include "dbg_gpu_gk20a.h" 36#include "dbg_gpu_gk20a.h"
36#include "fence_gk20a.h" 37#include "fence_gk20a.h"
37#include "semaphore_gk20a.h"
38 38
39#include <nvgpu/timers.h> 39#include <nvgpu/timers.h>
40 40
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
index c3c6fbb8..0eba1c30 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
@@ -1,9 +1,7 @@
1/* 1/*
2 * drivers/video/tegra/host/gk20a/channel_sync_gk20a.c
3 *
4 * GK20A Channel Synchronization Abstraction 2 * GK20A Channel Synchronization Abstraction
5 * 3 *
6 * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
7 * 5 *
8 * 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
9 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -20,10 +18,11 @@
20#include <linux/list.h> 18#include <linux/list.h>
21#include <linux/version.h> 19#include <linux/version.h>
22 20
21#include <nvgpu/semaphore.h>
22
23#include "channel_sync_gk20a.h" 23#include "channel_sync_gk20a.h"
24#include "gk20a.h" 24#include "gk20a.h"
25#include "fence_gk20a.h" 25#include "fence_gk20a.h"
26#include "semaphore_gk20a.h"
27#include "sync_gk20a.h" 26#include "sync_gk20a.h"
28#include "mm_gk20a.h" 27#include "mm_gk20a.h"
29 28
diff --git a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
index 37ba720a..83fdc05d 100644
--- a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * drivers/video/tegra/host/t20/debug_gk20a.c
3 *
4 * Copyright (C) 2011-2017 NVIDIA Corporation. All rights reserved. 2 * Copyright (C) 2011-2017 NVIDIA Corporation. All rights reserved.
5 * 3 *
6 * This software is licensed under the terms of the GNU General Public 4 * This software is licensed under the terms of the GNU General Public
@@ -20,12 +18,12 @@
20 18
21#include <linux/debugfs.h> 19#include <linux/debugfs.h>
22#include <linux/seq_file.h> 20#include <linux/seq_file.h>
23
24#include <linux/io.h> 21#include <linux/io.h>
25 22
23#include <nvgpu/semaphore.h>
24
26#include "gk20a.h" 25#include "gk20a.h"
27#include "debug_gk20a.h" 26#include "debug_gk20a.h"
28#include "semaphore_gk20a.h"
29 27
30#include <nvgpu/hw/gk20a/hw_ram_gk20a.h> 28#include <nvgpu/hw/gk20a/hw_ram_gk20a.h>
31#include <nvgpu/hw/gk20a/hw_fifo_gk20a.h> 29#include <nvgpu/hw/gk20a/hw_fifo_gk20a.h>
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
index b8a1dcbc..6bd59067 100644
--- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -17,8 +17,9 @@
17#include <linux/file.h> 17#include <linux/file.h>
18#include <linux/version.h> 18#include <linux/version.h>
19 19
20#include <nvgpu/semaphore.h>
21
20#include "gk20a.h" 22#include "gk20a.h"
21#include "semaphore_gk20a.h"
22#include "channel_gk20a.h" 23#include "channel_gk20a.h"
23#include "sync_gk20a.h" 24#include "sync_gk20a.h"
24 25
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
index 469148c2..c6b444f9 100644
--- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
@@ -25,11 +25,11 @@
25#include <linux/nvhost.h> 25#include <linux/nvhost.h>
26 26
27#include <nvgpu/timers.h> 27#include <nvgpu/timers.h>
28#include <nvgpu/semaphore.h>
28 29
29#include "gk20a.h" 30#include "gk20a.h"
30#include "debug_gk20a.h" 31#include "debug_gk20a.h"
31#include "ctxsw_trace_gk20a.h" 32#include "ctxsw_trace_gk20a.h"
32#include "semaphore_gk20a.h"
33 33
34#include <nvgpu/hw/gk20a/hw_fifo_gk20a.h> 34#include <nvgpu/hw/gk20a/hw_fifo_gk20a.h>
35#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> 35#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h>
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index cddb3316..0e1c88a4 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -41,7 +41,6 @@
41#include "regops_gk20a.h" 41#include "regops_gk20a.h"
42#include "dbg_gpu_gk20a.h" 42#include "dbg_gpu_gk20a.h"
43#include "debug_gk20a.h" 43#include "debug_gk20a.h"
44#include "semaphore_gk20a.h"
45#include "platform_gk20a.h" 44#include "platform_gk20a.h"
46#include "ctxsw_trace_gk20a.h" 45#include "ctxsw_trace_gk20a.h"
47 46
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index ea5ea73f..cafb1233 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -33,13 +33,13 @@
33 33
34#include <nvgpu/timers.h> 34#include <nvgpu/timers.h>
35#include <nvgpu/allocator.h> 35#include <nvgpu/allocator.h>
36#include <nvgpu/semaphore.h>
36#include <nvgpu/page_allocator.h> 37#include <nvgpu/page_allocator.h>
37 38
38#include "gk20a.h" 39#include "gk20a.h"
39#include "mm_gk20a.h" 40#include "mm_gk20a.h"
40#include "fence_gk20a.h" 41#include "fence_gk20a.h"
41#include "kind_gk20a.h" 42#include "kind_gk20a.h"
42#include "semaphore_gk20a.h"
43 43
44#include <nvgpu/hw/gk20a/hw_gmmu_gk20a.h> 44#include <nvgpu/hw/gk20a/hw_gmmu_gk20a.h>
45#include <nvgpu/hw/gk20a/hw_fb_gk20a.h> 45#include <nvgpu/hw/gk20a/hw_fb_gk20a.h>
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
index f3dffa46..d39ca2d0 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
@@ -52,6 +52,12 @@ enum gk20a_aperture {
52 APERTURE_VIDMEM 52 APERTURE_VIDMEM
53}; 53};
54 54
55enum gk20a_mem_rw_flag {
56 gk20a_mem_flag_none = 0,
57 gk20a_mem_flag_read_only = 1,
58 gk20a_mem_flag_write_only = 2,
59};
60
55static inline const char *gk20a_aperture_str(enum gk20a_aperture aperture) 61static inline const char *gk20a_aperture_str(enum gk20a_aperture aperture)
56{ 62{
57 switch (aperture) { 63 switch (aperture) {
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
index 9924e48f..d53cf09b 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
@@ -29,7 +29,6 @@
29 29
30#include "gk20a.h" 30#include "gk20a.h"
31#include "gr_gk20a.h" 31#include "gr_gk20a.h"
32#include "semaphore_gk20a.h"
33 32
34#include <nvgpu/hw/gk20a/hw_mc_gk20a.h> 33#include <nvgpu/hw/gk20a/hw_mc_gk20a.h>
35#include <nvgpu/hw/gk20a/hw_pwr_gk20a.h> 34#include <nvgpu/hw/gk20a/hw_pwr_gk20a.h>
diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c
index b642981c..e7bacac8 100644
--- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A Sync Framework Integration 2 * GK20A Sync Framework Integration
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,
@@ -13,8 +13,6 @@
13 * more details. 13 * more details.
14 */ 14 */
15 15
16#include "sync_gk20a.h"
17
18#include <linux/version.h> 16#include <linux/version.h>
19#include <linux/kernel.h> 17#include <linux/kernel.h>
20#include <linux/file.h> 18#include <linux/file.h>
@@ -23,9 +21,14 @@
23#include <linux/module.h> 21#include <linux/module.h>
24#include <linux/slab.h> 22#include <linux/slab.h>
25#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24
26#include <uapi/linux/nvgpu.h> 25#include <uapi/linux/nvgpu.h>
26
27#include <nvgpu/semaphore.h>
28
27#include "../drivers/staging/android/sync.h" 29#include "../drivers/staging/android/sync.h"
28#include "semaphore_gk20a.h" 30
31#include "sync_gk20a.h"
29 32
30static const struct sync_timeline_ops gk20a_sync_timeline_ops; 33static const struct sync_timeline_ops gk20a_sync_timeline_ops;
31 34
diff --git a/drivers/gpu/nvgpu/gm206/acr_gm206.c b/drivers/gpu/nvgpu/gm206/acr_gm206.c
index 238114e3..3af59374 100644
--- a/drivers/gpu/nvgpu/gm206/acr_gm206.c
+++ b/drivers/gpu/nvgpu/gm206/acr_gm206.c
@@ -21,7 +21,6 @@
21 21
22#include "gk20a/gk20a.h" 22#include "gk20a/gk20a.h"
23#include "gk20a/pmu_gk20a.h" 23#include "gk20a/pmu_gk20a.h"
24#include "gk20a/semaphore_gk20a.h"
25 24
26#include "acr.h" 25#include "acr.h"
27#include "acr_gm206.h" 26#include "acr_gm206.h"
diff --git a/drivers/gpu/nvgpu/gm206/ce_gm206.c b/drivers/gpu/nvgpu/gm206/ce_gm206.c
index 5d5fd432..dd3eac95 100644
--- a/drivers/gpu/nvgpu/gm206/ce_gm206.c
+++ b/drivers/gpu/nvgpu/gm206/ce_gm206.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GM206 Copy Engine. 2 * GM206 Copy Engine.
3 * 3 *
4 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2016-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,
@@ -29,7 +29,6 @@
29#include <linux/nvhost.h> 29#include <linux/nvhost.h>
30 30
31#include "gk20a/debug_gk20a.h" 31#include "gk20a/debug_gk20a.h"
32#include "gk20a/semaphore_gk20a.h"
33 32
34#include <nvgpu/hw/gm206/hw_ce2_gm206.h> 33#include <nvgpu/hw/gm206/hw_ce2_gm206.h>
35#include <nvgpu/hw/gm206/hw_pbdma_gm206.h> 34#include <nvgpu/hw/gm206/hw_pbdma_gm206.h>
diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
index 060dc778..40a28136 100644
--- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
@@ -26,7 +26,6 @@
26 26
27#include "gk20a/gk20a.h" 27#include "gk20a/gk20a.h"
28#include "gk20a/pmu_gk20a.h" 28#include "gk20a/pmu_gk20a.h"
29#include "gk20a/semaphore_gk20a.h"
30 29
31#include <nvgpu/hw/gm20b/hw_pwr_gm20b.h> 30#include <nvgpu/hw/gm20b/hw_pwr_gm20b.h>
32 31
diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c
index 9e844994..f8d7ba70 100644
--- a/drivers/gpu/nvgpu/gp106/acr_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c
@@ -21,7 +21,6 @@
21 21
22#include "gk20a/gk20a.h" 22#include "gk20a/gk20a.h"
23#include "gk20a/pmu_gk20a.h" 23#include "gk20a/pmu_gk20a.h"
24#include "gk20a/semaphore_gk20a.h"
25 24
26#include "gm206/acr_gm206.h" 25#include "gm206/acr_gm206.h"
27#include "gm20b/acr_gm20b.h" 26#include "gm20b/acr_gm20b.h"
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index e04aec7d..a7aa4003 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -24,7 +24,6 @@
24 24
25#include "gk20a/gk20a.h" 25#include "gk20a/gk20a.h"
26#include "gk20a/gr_gk20a.h" 26#include "gk20a/gr_gk20a.h"
27#include "gk20a/semaphore_gk20a.h"
28#include "gk20a/dbg_gpu_gk20a.h" 27#include "gk20a/dbg_gpu_gk20a.h"
29 28
30#include "gm20b/gr_gm20b.h" 29#include "gm20b/gr_gm20b.h"
diff --git a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
index 835d33f3..776bbe85 100644
--- a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GP10B MMU 2 * GP10B MMU
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,
@@ -17,7 +17,6 @@
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18 18
19#include "gk20a/gk20a.h" 19#include "gk20a/gk20a.h"
20#include "gk20a/semaphore_gk20a.h"
21 20
22#include "mm_gp10b.h" 21#include "mm_gp10b.h"
23#include "rpfb_gp10b.h" 22#include "rpfb_gp10b.h"
diff --git a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/semaphore.h
index 8e09fcfc..07a27584 100644
--- a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/semaphore.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -20,9 +20,9 @@
20 20
21#include <nvgpu/allocator.h> 21#include <nvgpu/allocator.h>
22 22
23#include "gk20a.h" 23#include "gk20a/gk20a.h"
24#include "mm_gk20a.h" 24#include "gk20a/mm_gk20a.h"
25#include "channel_gk20a.h" 25#include "gk20a/channel_gk20a.h"
26 26
27#define gpu_sema_dbg(fmt, args...) \ 27#define gpu_sema_dbg(fmt, args...) \
28 gk20a_dbg(gpu_dbg_sema, fmt, ##args) 28 gk20a_dbg(gpu_dbg_sema, fmt, ##args)
@@ -146,12 +146,6 @@ struct gk20a_semaphore_sea {
146 struct mutex sea_lock; /* Lock alloc/free calls. */ 146 struct mutex sea_lock; /* Lock alloc/free calls. */
147}; 147};
148 148
149enum gk20a_mem_rw_flag {
150 gk20a_mem_flag_none = 0,
151 gk20a_mem_flag_read_only = 1,
152 gk20a_mem_flag_write_only = 2,
153};
154
155/* 149/*
156 * Semaphore sea functions. 150 * Semaphore sea functions.
157 */ 151 */
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c
index 66fda2d9..3d908b0d 100644
--- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c
+++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Virtualized GPU Memory Management 2 * Virtualized GPU Memory Management
3 * 3 *
4 * Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2015-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,
@@ -16,7 +16,6 @@
16#include <linux/dma-mapping.h> 16#include <linux/dma-mapping.h>
17#include "vgpu/vgpu.h" 17#include "vgpu/vgpu.h"
18#include "vgpu_mm_gp10b.h" 18#include "vgpu_mm_gp10b.h"
19#include "gk20a/semaphore_gk20a.h"
20#include "gk20a/mm_gk20a.h" 19#include "gk20a/mm_gk20a.h"
21 20
22static int vgpu_gp10b_init_mm_setup_hw(struct gk20a *g) 21static int vgpu_gp10b_init_mm_setup_hw(struct gk20a *g)
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
index f97acd47..eb5f7749 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Virtualized GPU Memory Management 2 * Virtualized GPU Memory Management
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,
@@ -15,7 +15,6 @@
15 15
16#include <linux/dma-mapping.h> 16#include <linux/dma-mapping.h>
17#include "vgpu/vgpu.h" 17#include "vgpu/vgpu.h"
18#include "gk20a/semaphore_gk20a.h"
19#include "gk20a/mm_gk20a.h" 18#include "gk20a/mm_gk20a.h"
20 19
21static int vgpu_init_mm_setup_sw(struct gk20a *g) 20static int vgpu_init_mm_setup_sw(struct gk20a *g)