summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-08-22 11:31:32 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-22 15:44:41 -0400
commitbc87e8989ddf2f74ff2c988a25e4a81e559a5c30 (patch)
treeb8c45cecf50e3e3bb8967952de9f5047de60683f /drivers/gpu/nvgpu/gk20a
parent587666bd6cbb60e52698052c2b5c4a74f2165ecd (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>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c23
-rw-r--r--drivers/gpu/nvgpu/gk20a/fence_gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h8
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c5
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.h10
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/sync_gk20a.c29
-rw-r--r--drivers/gpu/nvgpu/gk20a/sync_gk20a.h2
9 files changed, 0 insertions, 80 deletions
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
1057static struct dma_buf *gk20a_vidbuf_export(struct gk20a_vidmem_buf *buf) 1057static 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
23struct sync_timeline; 21struct sync_timeline;
24struct sync_fence; 22struct sync_fence;
25struct sync_pt; 23struct sync_pt;