From bc87e8989ddf2f74ff2c988a25e4a81e559a5c30 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 22 Aug 2017 08:31:32 -0700 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1543499 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 23 ---------------------- drivers/gpu/nvgpu/gk20a/fence_gk20a.c | 1 - drivers/gpu/nvgpu/gk20a/gk20a.h | 8 -------- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 5 ----- drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 10 ---------- drivers/gpu/nvgpu/gk20a/platform_gk20a.h | 1 - drivers/gpu/nvgpu/gk20a/pmu_gk20a.h | 1 - drivers/gpu/nvgpu/gk20a/sync_gk20a.c | 29 ---------------------------- drivers/gpu/nvgpu/gk20a/sync_gk20a.h | 2 -- 9 files changed, 80 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') 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 @@ * more details. */ -#include - #include #include #include @@ -97,23 +95,15 @@ static int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd, return -EINVAL; /* validate syncpt ids */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) - list_for_each_entry(pt, &sync_fence->pt_list_head, pt_list) { -#else for (i = 0; i < sync_fence->num_fences; i++) { pt = sync_pt_from_fence(sync_fence->cbs[i].sync_pt); -#endif wait_id = nvgpu_nvhost_sync_pt_id(pt); if (!wait_id || !nvgpu_nvhost_syncpt_is_valid_pt_ext( sp->nvhost_dev, wait_id)) { sync_fence_put(sync_fence); return -EINVAL; } -#if !(LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)) } -#else - } -#endif num_wait_cmds = nvgpu_nvhost_sync_num_pts(sync_fence); if (num_wait_cmds == 0) { @@ -132,13 +122,9 @@ static int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd, } i = 0; -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) - list_for_each_entry(pt, &sync_fence->pt_list_head, pt_list) { -#else for (i = 0; i < sync_fence->num_fences; i++) { struct fence *f = sync_fence->cbs[i].sync_pt; struct sync_pt *pt = sync_pt_from_fence(f); -#endif u32 wait_id = nvgpu_nvhost_sync_pt_id(pt); u32 wait_value = nvgpu_nvhost_sync_pt_thresh(pt); @@ -154,12 +140,7 @@ static int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd, i * wait_cmd_size, wait_id, wait_value, sp->syncpt_buf.gpu_va); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) - i++; - } -#else } -#endif WARN_ON(i != num_wait_cmds); sync_fence_put(sync_fence); @@ -675,11 +656,7 @@ static int gk20a_channel_semaphore_wait_fd( } /* If the fence has signaled there is no reason to wait on it. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) - status = sync_fence->status; -#else status = atomic_read(&sync_fence->status); -#endif if (status == 0) { sync_fence_put(sync_fence); 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 @@ #include "fence_gk20a.h" #include -#include #include #include 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 { struct railgate_stats pstats; #endif u32 gr_idle_timeout_default; -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) - u32 timeouts_enabled; -#else bool timeouts_enabled; -#endif unsigned int ch_wdt_timeout_ms; struct nvgpu_mutex poweron_lock; @@ -1102,11 +1098,7 @@ struct gk20a { u32 timeslice_high_priority_us; u32 min_timeslice_us; u32 max_timeslice_us; -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) - u32 runlist_interleave; -#else bool runlist_interleave; -#endif bool slcg_enabled; 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 = { static struct dma_buf *gk20a_vidbuf_export(struct gk20a_vidmem_buf *buf) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) DEFINE_DMA_BUF_EXPORT_INFO(exp_info); exp_info.priv = buf; @@ -1065,10 +1064,6 @@ static struct dma_buf *gk20a_vidbuf_export(struct gk20a_vidmem_buf *buf) exp_info.flags = O_RDWR; return dma_buf_export(&exp_info); -#else - return dma_buf_export(buf, &gk20a_vidbuf_ops, buf->mem->size, - O_RDWR, NULL); -#endif } #endif 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 @@ #include #include -#include #include #include @@ -248,24 +247,15 @@ struct mm_gk20a { bool use_full_comp_tag_line; bool ltc_enabled_current; bool ltc_enabled_target; -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) - u32 bypass_smmu; - u32 disable_bigpage; -#else bool bypass_smmu; bool disable_bigpage; -#endif bool has_physical_mode; struct nvgpu_mem sysmem_flush; u32 pramin_window; struct nvgpu_spinlock pramin_window_lock; -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) - u32 force_pramin; /* via debugfs */ -#else bool force_pramin; /* via debugfs */ -#endif struct { 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 @@ #define _GK20A_PLATFORM_H_ #include -#include #include 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 @@ #ifndef __PMU_GK20A_H__ #define __PMU_GK20A_H__ -#include #include #include #include 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 @@ * more details. */ -#include #include #include #include @@ -75,23 +74,6 @@ int gk20a_is_sema_backed_sync_fence(struct sync_fence *fence) { struct sync_timeline *t; -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) - struct sync_pt *spt; - int i = 0; - - if (list_empty(&fence->pt_list_head)) - return 0; - - list_for_each_entry(spt, &fence->pt_list_head, pt_list) { - i++; - - if (i >= 2) - return 0; - } - - spt = list_first_entry(&fence->pt_list_head, struct sync_pt, pt_list); - t = spt->parent; -#else struct fence *pt = fence->cbs[0].sync_pt; struct sync_pt *spt = sync_pt_from_fence(pt); @@ -102,7 +84,6 @@ int gk20a_is_sema_backed_sync_fence(struct sync_fence *fence) return 0; t = sync_pt_parent(spt); -#endif if (t->ops == &gk20a_sync_timeline_ops) return 1; @@ -114,15 +95,6 @@ struct nvgpu_semaphore *gk20a_sync_fence_get_sema(struct sync_fence *f) struct sync_pt *spt; struct gk20a_sync_pt_inst *pti; -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) - if (!f) - return NULL; - - if (!gk20a_is_sema_backed_sync_fence(f)) - return NULL; - - spt = list_first_entry(&f->pt_list_head, struct sync_pt, pt_list); -#else struct fence *pt; if (!f) @@ -133,7 +105,6 @@ struct nvgpu_semaphore *gk20a_sync_fence_get_sema(struct sync_fence *f) pt = f->cbs[0].sync_pt; spt = sync_pt_from_fence(pt); -#endif pti = container_of(spt, struct gk20a_sync_pt_inst, pt); 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 @@ #ifndef _GK20A_SYNC_H_ #define _GK20A_SYNC_H_ -#include - struct sync_timeline; struct sync_fence; struct sync_pt; -- cgit v1.2.2