diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-08-22 11:31:32 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-22 15:44:41 -0400 |
commit | bc87e8989ddf2f74ff2c988a25e4a81e559a5c30 (patch) | |
tree | b8c45cecf50e3e3bb8967952de9f5047de60683f | |
parent | 587666bd6cbb60e52698052c2b5c4a74f2165ecd (diff) |
gpu: nvgpu: Remove support for old kernel version
Remove support for pre-4.4 kernels. This allows deleting the checks
for kernel version, and usage of linux/version.h.
Change-Id: I4d6cb30512ea164d27549f4f4d096e5931bb1379
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1543499
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/clk.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/dma.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/firmware.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/module.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/sysfs.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 23 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fence_gk20a.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 10 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/platform_gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/sync_gk20a.c | 29 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/sync_gk20a.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/gr_gm20b.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_gp10b.h | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/css_vgpu.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c | 5 |
19 files changed, 1 insertions, 112 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/clk.c b/drivers/gpu/nvgpu/common/linux/clk.c index 892b892a..3f768867 100644 --- a/drivers/gpu/nvgpu/common/linux/clk.c +++ b/drivers/gpu/nvgpu/common/linux/clk.c | |||
@@ -17,7 +17,6 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/version.h> | ||
21 | 20 | ||
22 | #include <soc/tegra/tegra-dvfs.h> | 21 | #include <soc/tegra/tegra-dvfs.h> |
23 | 22 | ||
diff --git a/drivers/gpu/nvgpu/common/linux/dma.c b/drivers/gpu/nvgpu/common/linux/dma.c index 2116053d..cd6ad1b2 100644 --- a/drivers/gpu/nvgpu/common/linux/dma.c +++ b/drivers/gpu/nvgpu/common/linux/dma.c | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | #include <linux/dma-attrs.h> | 17 | #include <linux/dma-attrs.h> |
18 | #include <linux/dma-mapping.h> | 18 | #include <linux/dma-mapping.h> |
19 | #include <linux/version.h> | ||
19 | 20 | ||
20 | #include <nvgpu/dma.h> | 21 | #include <nvgpu/dma.h> |
21 | #include <nvgpu/lock.h> | 22 | #include <nvgpu/lock.h> |
diff --git a/drivers/gpu/nvgpu/common/linux/firmware.c b/drivers/gpu/nvgpu/common/linux/firmware.c index b49bc4a3..44ff1507 100644 --- a/drivers/gpu/nvgpu/common/linux/firmware.c +++ b/drivers/gpu/nvgpu/common/linux/firmware.c | |||
@@ -44,14 +44,10 @@ static const struct firmware *do_request_firmware(struct device *dev, | |||
44 | fw_name = fw_path; | 44 | fw_name = fw_path; |
45 | } | 45 | } |
46 | 46 | ||
47 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) | ||
48 | err = request_firmware(&fw, fw_name, dev); | ||
49 | #else | ||
50 | if (flags & NVGPU_REQUEST_FIRMWARE_NO_WARN) | 47 | if (flags & NVGPU_REQUEST_FIRMWARE_NO_WARN) |
51 | err = request_firmware_direct(&fw, fw_name, dev); | 48 | err = request_firmware_direct(&fw, fw_name, dev); |
52 | else | 49 | else |
53 | err = request_firmware(&fw, fw_name, dev); | 50 | err = request_firmware(&fw, fw_name, dev); |
54 | #endif | ||
55 | 51 | ||
56 | nvgpu_kfree(get_gk20a(dev), fw_path); | 52 | nvgpu_kfree(get_gk20a(dev), fw_path); |
57 | if (err) | 53 | if (err) |
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index f5c6ca1f..691fdd69 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c | |||
@@ -1025,9 +1025,7 @@ static struct platform_driver gk20a_driver = { | |||
1025 | .driver = { | 1025 | .driver = { |
1026 | .owner = THIS_MODULE, | 1026 | .owner = THIS_MODULE, |
1027 | .name = "gk20a", | 1027 | .name = "gk20a", |
1028 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0) | ||
1029 | .probe_type = PROBE_PREFER_ASYNCHRONOUS, | 1028 | .probe_type = PROBE_PREFER_ASYNCHRONOUS, |
1030 | #endif | ||
1031 | #ifdef CONFIG_OF | 1029 | #ifdef CONFIG_OF |
1032 | .of_match_table = tegra_gk20a_of_match, | 1030 | .of_match_table = tegra_gk20a_of_match, |
1033 | #endif | 1031 | #endif |
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c index 71081be5..2c556d8a 100644 --- a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c | |||
@@ -13,7 +13,6 @@ | |||
13 | * more details. | 13 | * more details. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/version.h> | ||
17 | #include <linux/of_platform.h> | 16 | #include <linux/of_platform.h> |
18 | #include <linux/debugfs.h> | 17 | #include <linux/debugfs.h> |
19 | #include <linux/platform_data/tegra_edp.h> | 18 | #include <linux/platform_data/tegra_edp.h> |
@@ -822,10 +821,8 @@ static int gk20a_tegra_probe(struct device *dev) | |||
822 | dev_warn(dev, "board does not support scaling"); | 821 | dev_warn(dev, "board does not support scaling"); |
823 | } | 822 | } |
824 | platform->g->clk.gpc_pll.id = GM20B_GPC_PLL_B1; | 823 | platform->g->clk.gpc_pll.id = GM20B_GPC_PLL_B1; |
825 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) | ||
826 | if (tegra_chip_get_revision() > TEGRA210_REVISION_A04p) | 824 | if (tegra_chip_get_revision() > TEGRA210_REVISION_A04p) |
827 | platform->g->clk.gpc_pll.id = GM20B_GPC_PLL_C1; | 825 | platform->g->clk.gpc_pll.id = GM20B_GPC_PLL_C1; |
828 | #endif | ||
829 | } | 826 | } |
830 | 827 | ||
831 | if (tegra_get_chip_id() == TEGRA132) | 828 | if (tegra_get_chip_id() == TEGRA132) |
@@ -841,9 +838,7 @@ static int gk20a_tegra_probe(struct device *dev) | |||
841 | return ret; | 838 | return ret; |
842 | } | 839 | } |
843 | 840 | ||
844 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) | ||
845 | pmc = ioremap(TEGRA_PMC_BASE, 4096); | 841 | pmc = ioremap(TEGRA_PMC_BASE, 4096); |
846 | #endif | ||
847 | 842 | ||
848 | return 0; | 843 | return 0; |
849 | } | 844 | } |
diff --git a/drivers/gpu/nvgpu/common/linux/sysfs.c b/drivers/gpu/nvgpu/common/linux/sysfs.c index 28ebb21d..1b59c480 100644 --- a/drivers/gpu/nvgpu/common/linux/sysfs.c +++ b/drivers/gpu/nvgpu/common/linux/sysfs.c | |||
@@ -14,7 +14,6 @@ | |||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/version.h> | ||
18 | #include <linux/device.h> | 17 | #include <linux/device.h> |
19 | #include <linux/pm_runtime.h> | 18 | #include <linux/pm_runtime.h> |
20 | #include <linux/fb.h> | 19 | #include <linux/fb.h> |
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index aa340ba6..6a07406a 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | |||
@@ -13,8 +13,6 @@ | |||
13 | * more details. | 13 | * more details. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/version.h> | ||
17 | |||
18 | #include <nvgpu/semaphore.h> | 16 | #include <nvgpu/semaphore.h> |
19 | #include <nvgpu/kmem.h> | 17 | #include <nvgpu/kmem.h> |
20 | #include <nvgpu/log.h> | 18 | #include <nvgpu/log.h> |
@@ -97,23 +95,15 @@ static int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd, | |||
97 | return -EINVAL; | 95 | return -EINVAL; |
98 | 96 | ||
99 | /* validate syncpt ids */ | 97 | /* validate syncpt ids */ |
100 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) | ||
101 | list_for_each_entry(pt, &sync_fence->pt_list_head, pt_list) { | ||
102 | #else | ||
103 | for (i = 0; i < sync_fence->num_fences; i++) { | 98 | for (i = 0; i < sync_fence->num_fences; i++) { |
104 | pt = sync_pt_from_fence(sync_fence->cbs[i].sync_pt); | 99 | pt = sync_pt_from_fence(sync_fence->cbs[i].sync_pt); |
105 | #endif | ||
106 | wait_id = nvgpu_nvhost_sync_pt_id(pt); | 100 | wait_id = nvgpu_nvhost_sync_pt_id(pt); |
107 | if (!wait_id || !nvgpu_nvhost_syncpt_is_valid_pt_ext( | 101 | if (!wait_id || !nvgpu_nvhost_syncpt_is_valid_pt_ext( |
108 | sp->nvhost_dev, wait_id)) { | 102 | sp->nvhost_dev, wait_id)) { |
109 | sync_fence_put(sync_fence); | 103 | sync_fence_put(sync_fence); |
110 | return -EINVAL; | 104 | return -EINVAL; |
111 | } | 105 | } |
112 | #if !(LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)) | ||
113 | } | 106 | } |
114 | #else | ||
115 | } | ||
116 | #endif | ||
117 | 107 | ||
118 | num_wait_cmds = nvgpu_nvhost_sync_num_pts(sync_fence); | 108 | num_wait_cmds = nvgpu_nvhost_sync_num_pts(sync_fence); |
119 | if (num_wait_cmds == 0) { | 109 | if (num_wait_cmds == 0) { |
@@ -132,13 +122,9 @@ static int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd, | |||
132 | } | 122 | } |
133 | 123 | ||
134 | i = 0; | 124 | i = 0; |
135 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) | ||
136 | list_for_each_entry(pt, &sync_fence->pt_list_head, pt_list) { | ||
137 | #else | ||
138 | for (i = 0; i < sync_fence->num_fences; i++) { | 125 | for (i = 0; i < sync_fence->num_fences; i++) { |
139 | struct fence *f = sync_fence->cbs[i].sync_pt; | 126 | struct fence *f = sync_fence->cbs[i].sync_pt; |
140 | struct sync_pt *pt = sync_pt_from_fence(f); | 127 | struct sync_pt *pt = sync_pt_from_fence(f); |
141 | #endif | ||
142 | u32 wait_id = nvgpu_nvhost_sync_pt_id(pt); | 128 | u32 wait_id = nvgpu_nvhost_sync_pt_id(pt); |
143 | u32 wait_value = nvgpu_nvhost_sync_pt_thresh(pt); | 129 | u32 wait_value = nvgpu_nvhost_sync_pt_thresh(pt); |
144 | 130 | ||
@@ -154,12 +140,7 @@ static int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd, | |||
154 | i * wait_cmd_size, wait_id, wait_value, | 140 | i * wait_cmd_size, wait_id, wait_value, |
155 | sp->syncpt_buf.gpu_va); | 141 | sp->syncpt_buf.gpu_va); |
156 | } | 142 | } |
157 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) | ||
158 | i++; | ||
159 | } | ||
160 | #else | ||
161 | } | 143 | } |
162 | #endif | ||
163 | 144 | ||
164 | WARN_ON(i != num_wait_cmds); | 145 | WARN_ON(i != num_wait_cmds); |
165 | sync_fence_put(sync_fence); | 146 | sync_fence_put(sync_fence); |
@@ -675,11 +656,7 @@ static int gk20a_channel_semaphore_wait_fd( | |||
675 | } | 656 | } |
676 | 657 | ||
677 | /* If the fence has signaled there is no reason to wait on it. */ | 658 | /* If the fence has signaled there is no reason to wait on it. */ |
678 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) | ||
679 | status = sync_fence->status; | ||
680 | #else | ||
681 | status = atomic_read(&sync_fence->status); | 659 | status = atomic_read(&sync_fence->status); |
682 | #endif | ||
683 | if (status == 0) { | 660 | if (status == 0) { |
684 | sync_fence_put(sync_fence); | 661 | sync_fence_put(sync_fence); |
685 | goto skip_slow_path; | 662 | goto skip_slow_path; |
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c index 5fa9a0df..a7250b17 100644 --- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include "fence_gk20a.h" | 14 | #include "fence_gk20a.h" |
15 | 15 | ||
16 | #include <linux/file.h> | 16 | #include <linux/file.h> |
17 | #include <linux/version.h> | ||
18 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
19 | 18 | ||
20 | #include <nvgpu/semaphore.h> | 19 | #include <nvgpu/semaphore.h> |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 8f097cac..5efa846d 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -1086,11 +1086,7 @@ struct gk20a { | |||
1086 | struct railgate_stats pstats; | 1086 | struct railgate_stats pstats; |
1087 | #endif | 1087 | #endif |
1088 | u32 gr_idle_timeout_default; | 1088 | u32 gr_idle_timeout_default; |
1089 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) | ||
1090 | u32 timeouts_enabled; | ||
1091 | #else | ||
1092 | bool timeouts_enabled; | 1089 | bool timeouts_enabled; |
1093 | #endif | ||
1094 | unsigned int ch_wdt_timeout_ms; | 1090 | unsigned int ch_wdt_timeout_ms; |
1095 | 1091 | ||
1096 | struct nvgpu_mutex poweron_lock; | 1092 | struct nvgpu_mutex poweron_lock; |
@@ -1102,11 +1098,7 @@ struct gk20a { | |||
1102 | u32 timeslice_high_priority_us; | 1098 | u32 timeslice_high_priority_us; |
1103 | u32 min_timeslice_us; | 1099 | u32 min_timeslice_us; |
1104 | u32 max_timeslice_us; | 1100 | u32 max_timeslice_us; |
1105 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) | ||
1106 | u32 runlist_interleave; | ||
1107 | #else | ||
1108 | bool runlist_interleave; | 1101 | bool runlist_interleave; |
1109 | #endif | ||
1110 | 1102 | ||
1111 | bool slcg_enabled; | 1103 | bool slcg_enabled; |
1112 | bool blcg_enabled; | 1104 | bool blcg_enabled; |
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index e21be1e5..2ce78cef 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -1056,7 +1056,6 @@ static const struct dma_buf_ops gk20a_vidbuf_ops = { | |||
1056 | 1056 | ||
1057 | static struct dma_buf *gk20a_vidbuf_export(struct gk20a_vidmem_buf *buf) | 1057 | static struct dma_buf *gk20a_vidbuf_export(struct gk20a_vidmem_buf *buf) |
1058 | { | 1058 | { |
1059 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) | ||
1060 | DEFINE_DMA_BUF_EXPORT_INFO(exp_info); | 1059 | DEFINE_DMA_BUF_EXPORT_INFO(exp_info); |
1061 | 1060 | ||
1062 | exp_info.priv = buf; | 1061 | exp_info.priv = buf; |
@@ -1065,10 +1064,6 @@ static struct dma_buf *gk20a_vidbuf_export(struct gk20a_vidmem_buf *buf) | |||
1065 | exp_info.flags = O_RDWR; | 1064 | exp_info.flags = O_RDWR; |
1066 | 1065 | ||
1067 | return dma_buf_export(&exp_info); | 1066 | return dma_buf_export(&exp_info); |
1068 | #else | ||
1069 | return dma_buf_export(buf, &gk20a_vidbuf_ops, buf->mem->size, | ||
1070 | O_RDWR, NULL); | ||
1071 | #endif | ||
1072 | } | 1067 | } |
1073 | #endif | 1068 | #endif |
1074 | 1069 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index af176a73..e8b90c8f 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h | |||
@@ -20,7 +20,6 @@ | |||
20 | 20 | ||
21 | #include <linux/scatterlist.h> | 21 | #include <linux/scatterlist.h> |
22 | #include <linux/iommu.h> | 22 | #include <linux/iommu.h> |
23 | #include <linux/version.h> | ||
24 | #include <asm/dma-iommu.h> | 23 | #include <asm/dma-iommu.h> |
25 | #include <asm/cacheflush.h> | 24 | #include <asm/cacheflush.h> |
26 | 25 | ||
@@ -248,24 +247,15 @@ struct mm_gk20a { | |||
248 | bool use_full_comp_tag_line; | 247 | bool use_full_comp_tag_line; |
249 | bool ltc_enabled_current; | 248 | bool ltc_enabled_current; |
250 | bool ltc_enabled_target; | 249 | bool ltc_enabled_target; |
251 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) | ||
252 | u32 bypass_smmu; | ||
253 | u32 disable_bigpage; | ||
254 | #else | ||
255 | bool bypass_smmu; | 250 | bool bypass_smmu; |
256 | bool disable_bigpage; | 251 | bool disable_bigpage; |
257 | #endif | ||
258 | bool has_physical_mode; | 252 | bool has_physical_mode; |
259 | 253 | ||
260 | struct nvgpu_mem sysmem_flush; | 254 | struct nvgpu_mem sysmem_flush; |
261 | 255 | ||
262 | u32 pramin_window; | 256 | u32 pramin_window; |
263 | struct nvgpu_spinlock pramin_window_lock; | 257 | struct nvgpu_spinlock pramin_window_lock; |
264 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) | ||
265 | u32 force_pramin; /* via debugfs */ | ||
266 | #else | ||
267 | bool force_pramin; /* via debugfs */ | 258 | bool force_pramin; /* via debugfs */ |
268 | #endif | ||
269 | 259 | ||
270 | struct { | 260 | struct { |
271 | size_t size; | 261 | size_t size; |
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h index 791286f0..36938069 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h | |||
@@ -17,7 +17,6 @@ | |||
17 | #define _GK20A_PLATFORM_H_ | 17 | #define _GK20A_PLATFORM_H_ |
18 | 18 | ||
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | #include <linux/version.h> | ||
21 | 20 | ||
22 | #include <nvgpu/lock.h> | 21 | #include <nvgpu/lock.h> |
23 | 22 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h index f4e8c601..3ad0c116 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h | |||
@@ -21,7 +21,6 @@ | |||
21 | #ifndef __PMU_GK20A_H__ | 21 | #ifndef __PMU_GK20A_H__ |
22 | #define __PMU_GK20A_H__ | 22 | #define __PMU_GK20A_H__ |
23 | 23 | ||
24 | #include <linux/version.h> | ||
25 | #include <nvgpu/flcnif_cmn.h> | 24 | #include <nvgpu/flcnif_cmn.h> |
26 | #include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h> | 25 | #include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h> |
27 | #include <nvgpu/pmu.h> | 26 | #include <nvgpu/pmu.h> |
diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c index 247f3d63..deaf19a1 100644 --- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c | |||
@@ -13,7 +13,6 @@ | |||
13 | * more details. | 13 | * more details. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/version.h> | ||
17 | #include <linux/file.h> | 16 | #include <linux/file.h> |
18 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
19 | #include <linux/hrtimer.h> | 18 | #include <linux/hrtimer.h> |
@@ -75,23 +74,6 @@ int gk20a_is_sema_backed_sync_fence(struct sync_fence *fence) | |||
75 | { | 74 | { |
76 | struct sync_timeline *t; | 75 | struct sync_timeline *t; |
77 | 76 | ||
78 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) | ||
79 | struct sync_pt *spt; | ||
80 | int i = 0; | ||
81 | |||
82 | if (list_empty(&fence->pt_list_head)) | ||
83 | return 0; | ||
84 | |||
85 | list_for_each_entry(spt, &fence->pt_list_head, pt_list) { | ||
86 | i++; | ||
87 | |||
88 | if (i >= 2) | ||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | spt = list_first_entry(&fence->pt_list_head, struct sync_pt, pt_list); | ||
93 | t = spt->parent; | ||
94 | #else | ||
95 | struct fence *pt = fence->cbs[0].sync_pt; | 77 | struct fence *pt = fence->cbs[0].sync_pt; |
96 | struct sync_pt *spt = sync_pt_from_fence(pt); | 78 | struct sync_pt *spt = sync_pt_from_fence(pt); |
97 | 79 | ||
@@ -102,7 +84,6 @@ int gk20a_is_sema_backed_sync_fence(struct sync_fence *fence) | |||
102 | return 0; | 84 | return 0; |
103 | 85 | ||
104 | t = sync_pt_parent(spt); | 86 | t = sync_pt_parent(spt); |
105 | #endif | ||
106 | 87 | ||
107 | if (t->ops == &gk20a_sync_timeline_ops) | 88 | if (t->ops == &gk20a_sync_timeline_ops) |
108 | return 1; | 89 | return 1; |
@@ -114,15 +95,6 @@ struct nvgpu_semaphore *gk20a_sync_fence_get_sema(struct sync_fence *f) | |||
114 | struct sync_pt *spt; | 95 | struct sync_pt *spt; |
115 | struct gk20a_sync_pt_inst *pti; | 96 | struct gk20a_sync_pt_inst *pti; |
116 | 97 | ||
117 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) | ||
118 | if (!f) | ||
119 | return NULL; | ||
120 | |||
121 | if (!gk20a_is_sema_backed_sync_fence(f)) | ||
122 | return NULL; | ||
123 | |||
124 | spt = list_first_entry(&f->pt_list_head, struct sync_pt, pt_list); | ||
125 | #else | ||
126 | struct fence *pt; | 98 | struct fence *pt; |
127 | 99 | ||
128 | if (!f) | 100 | if (!f) |
@@ -133,7 +105,6 @@ struct nvgpu_semaphore *gk20a_sync_fence_get_sema(struct sync_fence *f) | |||
133 | 105 | ||
134 | pt = f->cbs[0].sync_pt; | 106 | pt = f->cbs[0].sync_pt; |
135 | spt = sync_pt_from_fence(pt); | 107 | spt = sync_pt_from_fence(pt); |
136 | #endif | ||
137 | pti = container_of(spt, struct gk20a_sync_pt_inst, pt); | 108 | pti = container_of(spt, struct gk20a_sync_pt_inst, pt); |
138 | 109 | ||
139 | return pti->shared->sema; | 110 | return pti->shared->sema; |
diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.h b/drivers/gpu/nvgpu/gk20a/sync_gk20a.h index a422377c..be8219cc 100644 --- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/sync_gk20a.h | |||
@@ -18,8 +18,6 @@ | |||
18 | #ifndef _GK20A_SYNC_H_ | 18 | #ifndef _GK20A_SYNC_H_ |
19 | #define _GK20A_SYNC_H_ | 19 | #define _GK20A_SYNC_H_ |
20 | 20 | ||
21 | #include <linux/version.h> | ||
22 | |||
23 | struct sync_timeline; | 21 | struct sync_timeline; |
24 | struct sync_fence; | 22 | struct sync_fence; |
25 | struct sync_pt; | 23 | struct sync_pt; |
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.h b/drivers/gpu/nvgpu/gm20b/gr_gm20b.h index d3adacd8..116a92f4 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.h +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.h | |||
@@ -16,8 +16,6 @@ | |||
16 | #ifndef _NVHOST_GM20B_GR_MMU_H | 16 | #ifndef _NVHOST_GM20B_GR_MMU_H |
17 | #define _NVHOST_GM20B_GR_MMU_H | 17 | #define _NVHOST_GM20B_GR_MMU_H |
18 | 18 | ||
19 | #include <linux/version.h> | ||
20 | |||
21 | struct gk20a; | 19 | struct gk20a; |
22 | 20 | ||
23 | enum { | 21 | enum { |
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h index 42a647b4..ac53e231 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h | |||
@@ -16,8 +16,6 @@ | |||
16 | #ifndef _NVGPU_GR_GP10B_H_ | 16 | #ifndef _NVGPU_GR_GP10B_H_ |
17 | #define _NVGPU_GR_GP10B_H_ | 17 | #define _NVGPU_GR_GP10B_H_ |
18 | 18 | ||
19 | #include <linux/version.h> | ||
20 | |||
21 | #include "gk20a/mm_gk20a.h" | 19 | #include "gk20a/mm_gk20a.h" |
22 | 20 | ||
23 | struct gk20a; | 21 | struct gk20a; |
@@ -55,15 +53,9 @@ int gr_gp10b_set_cilp_preempt_pending(struct gk20a *g, | |||
55 | struct gr_t18x { | 53 | struct gr_t18x { |
56 | struct { | 54 | struct { |
57 | u32 preempt_image_size; | 55 | u32 preempt_image_size; |
58 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) | ||
59 | u32 force_preemption_gfxp; | ||
60 | u32 force_preemption_cilp; | ||
61 | u32 dump_ctxsw_stats_on_channel_close; | ||
62 | #else | ||
63 | bool force_preemption_gfxp; | 56 | bool force_preemption_gfxp; |
64 | bool force_preemption_cilp; | 57 | bool force_preemption_cilp; |
65 | bool dump_ctxsw_stats_on_channel_close; | 58 | bool dump_ctxsw_stats_on_channel_close; |
66 | #endif | ||
67 | } ctx_vars; | 59 | } ctx_vars; |
68 | 60 | ||
69 | u32 fecs_feature_override_ecc_val; | 61 | u32 fecs_feature_override_ecc_val; |
diff --git a/drivers/gpu/nvgpu/vgpu/css_vgpu.c b/drivers/gpu/nvgpu/vgpu/css_vgpu.c index a06ca037..d14f0da3 100644 --- a/drivers/gpu/nvgpu/vgpu/css_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/css_vgpu.c | |||
@@ -68,11 +68,7 @@ static int vgpu_css_init_snapshot_buffer(struct gr_gk20a *gr) | |||
68 | goto fail; | 68 | goto fail; |
69 | } | 69 | } |
70 | 70 | ||
71 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) | ||
72 | buf = ioremap_cached(css_cookie->ipa, css_cookie->size); | ||
73 | #else | ||
74 | buf = ioremap_cache(css_cookie->ipa, css_cookie->size); | 71 | buf = ioremap_cache(css_cookie->ipa, css_cookie->size); |
75 | #endif | ||
76 | if (!buf) { | 72 | if (!buf) { |
77 | nvgpu_info(g, "ioremap_cache failed"); | 73 | nvgpu_info(g, "ioremap_cache failed"); |
78 | err = -EINVAL; | 74 | err = -EINVAL; |
diff --git a/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c b/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c index 7cab4d1e..d201d596 100644 --- a/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/string.h> | 14 | #include <linux/string.h> |
15 | #include <linux/tegra-ivc.h> | 15 | #include <linux/tegra-ivc.h> |
16 | #include <linux/tegra_vgpu.h> | 16 | #include <linux/tegra_vgpu.h> |
17 | #include <linux/version.h> | ||
18 | 17 | ||
19 | #include <nvgpu/kmem.h> | 18 | #include <nvgpu/kmem.h> |
20 | #include <nvgpu/bug.h> | 19 | #include <nvgpu/bug.h> |
@@ -69,11 +68,7 @@ static int vgpu_fecs_trace_init(struct gk20a *g) | |||
69 | goto fail; | 68 | goto fail; |
70 | } | 69 | } |
71 | 70 | ||
72 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) | ||
73 | vcst->buf = ioremap_cached(vcst->cookie->ipa, vcst->cookie->size); | ||
74 | #else | ||
75 | vcst->buf = ioremap_cache(vcst->cookie->ipa, vcst->cookie->size); | 71 | vcst->buf = ioremap_cache(vcst->cookie->ipa, vcst->cookie->size); |
76 | #endif | ||
77 | if (!vcst->buf) { | 72 | if (!vcst->buf) { |
78 | dev_info(dev_from_gk20a(g), "ioremap_cache failed\n"); | 73 | dev_info(dev_from_gk20a(g), "ioremap_cache failed\n"); |
79 | err = -EINVAL; | 74 | err = -EINVAL; |