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>
This commit is contained in:
Terje Bergstrom
2017-08-22 08:31:32 -07:00
committed by mobile promotions
parent 587666bd6c
commit bc87e8989d
19 changed files with 1 additions and 112 deletions

View File

@@ -17,7 +17,6 @@
*/ */
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/version.h>
#include <soc/tegra/tegra-dvfs.h> #include <soc/tegra/tegra-dvfs.h>

View File

@@ -16,6 +16,7 @@
#include <linux/dma-attrs.h> #include <linux/dma-attrs.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/version.h>
#include <nvgpu/dma.h> #include <nvgpu/dma.h>
#include <nvgpu/lock.h> #include <nvgpu/lock.h>

View File

@@ -44,14 +44,10 @@ static const struct firmware *do_request_firmware(struct device *dev,
fw_name = fw_path; fw_name = fw_path;
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
err = request_firmware(&fw, fw_name, dev);
#else
if (flags & NVGPU_REQUEST_FIRMWARE_NO_WARN) if (flags & NVGPU_REQUEST_FIRMWARE_NO_WARN)
err = request_firmware_direct(&fw, fw_name, dev); err = request_firmware_direct(&fw, fw_name, dev);
else else
err = request_firmware(&fw, fw_name, dev); err = request_firmware(&fw, fw_name, dev);
#endif
nvgpu_kfree(get_gk20a(dev), fw_path); nvgpu_kfree(get_gk20a(dev), fw_path);
if (err) if (err)

View File

@@ -1025,9 +1025,7 @@ static struct platform_driver gk20a_driver = {
.driver = { .driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "gk20a", .name = "gk20a",
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
#endif
#ifdef CONFIG_OF #ifdef CONFIG_OF
.of_match_table = tegra_gk20a_of_match, .of_match_table = tegra_gk20a_of_match,
#endif #endif

View File

@@ -13,7 +13,6 @@
* more details. * more details.
*/ */
#include <linux/version.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/platform_data/tegra_edp.h> #include <linux/platform_data/tegra_edp.h>
@@ -822,10 +821,8 @@ static int gk20a_tegra_probe(struct device *dev)
dev_warn(dev, "board does not support scaling"); dev_warn(dev, "board does not support scaling");
} }
platform->g->clk.gpc_pll.id = GM20B_GPC_PLL_B1; platform->g->clk.gpc_pll.id = GM20B_GPC_PLL_B1;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
if (tegra_chip_get_revision() > TEGRA210_REVISION_A04p) if (tegra_chip_get_revision() > TEGRA210_REVISION_A04p)
platform->g->clk.gpc_pll.id = GM20B_GPC_PLL_C1; platform->g->clk.gpc_pll.id = GM20B_GPC_PLL_C1;
#endif
} }
if (tegra_get_chip_id() == TEGRA132) if (tegra_get_chip_id() == TEGRA132)
@@ -841,9 +838,7 @@ static int gk20a_tegra_probe(struct device *dev)
return ret; return ret;
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
pmc = ioremap(TEGRA_PMC_BASE, 4096); pmc = ioremap(TEGRA_PMC_BASE, 4096);
#endif
return 0; return 0;
} }

View File

@@ -14,7 +14,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <linux/version.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/fb.h> #include <linux/fb.h>

View File

@@ -13,8 +13,6 @@
* more details. * more details.
*/ */
#include <linux/version.h>
#include <nvgpu/semaphore.h> #include <nvgpu/semaphore.h>
#include <nvgpu/kmem.h> #include <nvgpu/kmem.h>
#include <nvgpu/log.h> #include <nvgpu/log.h>
@@ -97,23 +95,15 @@ static int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd,
return -EINVAL; return -EINVAL;
/* validate syncpt ids */ /* 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++) { for (i = 0; i < sync_fence->num_fences; i++) {
pt = sync_pt_from_fence(sync_fence->cbs[i].sync_pt); pt = sync_pt_from_fence(sync_fence->cbs[i].sync_pt);
#endif
wait_id = nvgpu_nvhost_sync_pt_id(pt); wait_id = nvgpu_nvhost_sync_pt_id(pt);
if (!wait_id || !nvgpu_nvhost_syncpt_is_valid_pt_ext( if (!wait_id || !nvgpu_nvhost_syncpt_is_valid_pt_ext(
sp->nvhost_dev, wait_id)) { sp->nvhost_dev, wait_id)) {
sync_fence_put(sync_fence); sync_fence_put(sync_fence);
return -EINVAL; return -EINVAL;
} }
#if !(LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0))
} }
#else
}
#endif
num_wait_cmds = nvgpu_nvhost_sync_num_pts(sync_fence); num_wait_cmds = nvgpu_nvhost_sync_num_pts(sync_fence);
if (num_wait_cmds == 0) { 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; 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++) { for (i = 0; i < sync_fence->num_fences; i++) {
struct fence *f = sync_fence->cbs[i].sync_pt; struct fence *f = sync_fence->cbs[i].sync_pt;
struct sync_pt *pt = sync_pt_from_fence(f); struct sync_pt *pt = sync_pt_from_fence(f);
#endif
u32 wait_id = nvgpu_nvhost_sync_pt_id(pt); u32 wait_id = nvgpu_nvhost_sync_pt_id(pt);
u32 wait_value = nvgpu_nvhost_sync_pt_thresh(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, i * wait_cmd_size, wait_id, wait_value,
sp->syncpt_buf.gpu_va); sp->syncpt_buf.gpu_va);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
i++;
} }
#else
}
#endif
WARN_ON(i != num_wait_cmds); WARN_ON(i != num_wait_cmds);
sync_fence_put(sync_fence); 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 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); status = atomic_read(&sync_fence->status);
#endif
if (status == 0) { if (status == 0) {
sync_fence_put(sync_fence); sync_fence_put(sync_fence);
goto skip_slow_path; goto skip_slow_path;

View File

@@ -14,7 +14,6 @@
#include "fence_gk20a.h" #include "fence_gk20a.h"
#include <linux/file.h> #include <linux/file.h>
#include <linux/version.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <nvgpu/semaphore.h> #include <nvgpu/semaphore.h>

View File

@@ -1086,11 +1086,7 @@ struct gk20a {
struct railgate_stats pstats; struct railgate_stats pstats;
#endif #endif
u32 gr_idle_timeout_default; u32 gr_idle_timeout_default;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
u32 timeouts_enabled;
#else
bool timeouts_enabled; bool timeouts_enabled;
#endif
unsigned int ch_wdt_timeout_ms; unsigned int ch_wdt_timeout_ms;
struct nvgpu_mutex poweron_lock; struct nvgpu_mutex poweron_lock;
@@ -1102,11 +1098,7 @@ struct gk20a {
u32 timeslice_high_priority_us; u32 timeslice_high_priority_us;
u32 min_timeslice_us; u32 min_timeslice_us;
u32 max_timeslice_us; u32 max_timeslice_us;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
u32 runlist_interleave;
#else
bool runlist_interleave; bool runlist_interleave;
#endif
bool slcg_enabled; bool slcg_enabled;
bool blcg_enabled; bool blcg_enabled;

View File

@@ -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) 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); DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
exp_info.priv = buf; 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; exp_info.flags = O_RDWR;
return dma_buf_export(&exp_info); return dma_buf_export(&exp_info);
#else
return dma_buf_export(buf, &gk20a_vidbuf_ops, buf->mem->size,
O_RDWR, NULL);
#endif
} }
#endif #endif

View File

@@ -20,7 +20,6 @@
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <linux/iommu.h> #include <linux/iommu.h>
#include <linux/version.h>
#include <asm/dma-iommu.h> #include <asm/dma-iommu.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
@@ -248,24 +247,15 @@ struct mm_gk20a {
bool use_full_comp_tag_line; bool use_full_comp_tag_line;
bool ltc_enabled_current; bool ltc_enabled_current;
bool ltc_enabled_target; bool ltc_enabled_target;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
u32 bypass_smmu;
u32 disable_bigpage;
#else
bool bypass_smmu; bool bypass_smmu;
bool disable_bigpage; bool disable_bigpage;
#endif
bool has_physical_mode; bool has_physical_mode;
struct nvgpu_mem sysmem_flush; struct nvgpu_mem sysmem_flush;
u32 pramin_window; u32 pramin_window;
struct nvgpu_spinlock pramin_window_lock; 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 */ bool force_pramin; /* via debugfs */
#endif
struct { struct {
size_t size; size_t size;

View File

@@ -17,7 +17,6 @@
#define _GK20A_PLATFORM_H_ #define _GK20A_PLATFORM_H_
#include <linux/device.h> #include <linux/device.h>
#include <linux/version.h>
#include <nvgpu/lock.h> #include <nvgpu/lock.h>

View File

@@ -21,7 +21,6 @@
#ifndef __PMU_GK20A_H__ #ifndef __PMU_GK20A_H__
#define __PMU_GK20A_H__ #define __PMU_GK20A_H__
#include <linux/version.h>
#include <nvgpu/flcnif_cmn.h> #include <nvgpu/flcnif_cmn.h>
#include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h> #include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h>
#include <nvgpu/pmu.h> #include <nvgpu/pmu.h>

View File

@@ -13,7 +13,6 @@
* more details. * more details.
*/ */
#include <linux/version.h>
#include <linux/file.h> #include <linux/file.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/hrtimer.h> #include <linux/hrtimer.h>
@@ -75,23 +74,6 @@ int gk20a_is_sema_backed_sync_fence(struct sync_fence *fence)
{ {
struct sync_timeline *t; 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 fence *pt = fence->cbs[0].sync_pt;
struct sync_pt *spt = sync_pt_from_fence(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; return 0;
t = sync_pt_parent(spt); t = sync_pt_parent(spt);
#endif
if (t->ops == &gk20a_sync_timeline_ops) if (t->ops == &gk20a_sync_timeline_ops)
return 1; return 1;
@@ -114,15 +95,6 @@ struct nvgpu_semaphore *gk20a_sync_fence_get_sema(struct sync_fence *f)
struct sync_pt *spt; struct sync_pt *spt;
struct gk20a_sync_pt_inst *pti; 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; struct fence *pt;
if (!f) if (!f)
@@ -133,7 +105,6 @@ struct nvgpu_semaphore *gk20a_sync_fence_get_sema(struct sync_fence *f)
pt = f->cbs[0].sync_pt; pt = f->cbs[0].sync_pt;
spt = sync_pt_from_fence(pt); spt = sync_pt_from_fence(pt);
#endif
pti = container_of(spt, struct gk20a_sync_pt_inst, pt); pti = container_of(spt, struct gk20a_sync_pt_inst, pt);
return pti->shared->sema; return pti->shared->sema;

View File

@@ -18,8 +18,6 @@
#ifndef _GK20A_SYNC_H_ #ifndef _GK20A_SYNC_H_
#define _GK20A_SYNC_H_ #define _GK20A_SYNC_H_
#include <linux/version.h>
struct sync_timeline; struct sync_timeline;
struct sync_fence; struct sync_fence;
struct sync_pt; struct sync_pt;

View File

@@ -16,8 +16,6 @@
#ifndef _NVHOST_GM20B_GR_MMU_H #ifndef _NVHOST_GM20B_GR_MMU_H
#define _NVHOST_GM20B_GR_MMU_H #define _NVHOST_GM20B_GR_MMU_H
#include <linux/version.h>
struct gk20a; struct gk20a;
enum { enum {

View File

@@ -16,8 +16,6 @@
#ifndef _NVGPU_GR_GP10B_H_ #ifndef _NVGPU_GR_GP10B_H_
#define _NVGPU_GR_GP10B_H_ #define _NVGPU_GR_GP10B_H_
#include <linux/version.h>
#include "gk20a/mm_gk20a.h" #include "gk20a/mm_gk20a.h"
struct gk20a; struct gk20a;
@@ -55,15 +53,9 @@ int gr_gp10b_set_cilp_preempt_pending(struct gk20a *g,
struct gr_t18x { struct gr_t18x {
struct { struct {
u32 preempt_image_size; u32 preempt_image_size;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
u32 force_preemption_gfxp;
u32 force_preemption_cilp;
u32 dump_ctxsw_stats_on_channel_close;
#else
bool force_preemption_gfxp; bool force_preemption_gfxp;
bool force_preemption_cilp; bool force_preemption_cilp;
bool dump_ctxsw_stats_on_channel_close; bool dump_ctxsw_stats_on_channel_close;
#endif
} ctx_vars; } ctx_vars;
u32 fecs_feature_override_ecc_val; u32 fecs_feature_override_ecc_val;

View File

@@ -68,11 +68,7 @@ static int vgpu_css_init_snapshot_buffer(struct gr_gk20a *gr)
goto fail; goto fail;
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
buf = ioremap_cached(css_cookie->ipa, css_cookie->size);
#else
buf = ioremap_cache(css_cookie->ipa, css_cookie->size); buf = ioremap_cache(css_cookie->ipa, css_cookie->size);
#endif
if (!buf) { if (!buf) {
nvgpu_info(g, "ioremap_cache failed"); nvgpu_info(g, "ioremap_cache failed");
err = -EINVAL; err = -EINVAL;

View File

@@ -14,7 +14,6 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/tegra-ivc.h> #include <linux/tegra-ivc.h>
#include <linux/tegra_vgpu.h> #include <linux/tegra_vgpu.h>
#include <linux/version.h>
#include <nvgpu/kmem.h> #include <nvgpu/kmem.h>
#include <nvgpu/bug.h> #include <nvgpu/bug.h>
@@ -69,11 +68,7 @@ static int vgpu_fecs_trace_init(struct gk20a *g)
goto fail; goto fail;
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
vcst->buf = ioremap_cached(vcst->cookie->ipa, vcst->cookie->size);
#else
vcst->buf = ioremap_cache(vcst->cookie->ipa, vcst->cookie->size); vcst->buf = ioremap_cache(vcst->cookie->ipa, vcst->cookie->size);
#endif
if (!vcst->buf) { if (!vcst->buf) {
dev_info(dev_from_gk20a(g), "ioremap_cache failed\n"); dev_info(dev_from_gk20a(g), "ioremap_cache failed\n");
err = -EINVAL; err = -EINVAL;