summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
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/channel_sync_gk20a.c
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/channel_sync_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c23
1 files changed, 0 insertions, 23 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;