From b53b2973fedaa7340b2066f5c1dffbaa78c478d7 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 16 Feb 2015 14:39:26 -0800 Subject: gpu: nvgpu: Fix/HACK for v3.18 Signed-off-by: Dan Willemsen --- drivers/gpu/nvgpu/Makefile | 1 + drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 5 ----- drivers/gpu/nvgpu/gk20a/gk20a.c | 5 +++++ drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | 4 ++-- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 16 ++++++++-------- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index f189cdc9..fd292b70 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -5,6 +5,7 @@ ccflags-y += -Idrivers/video/tegra/host ccflags-y += -Idrivers/devfreq ccflags-y += -Wno-multichar ccflags-y += -Werror +ccflags-y += -Wno-error=cpp ifeq ($(CONFIG_ARCH_TEGRA_18x_SOC),y) ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/drivers/gpu/nvgpu diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index c60afb97..9982b1e0 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h @@ -51,11 +51,6 @@ struct notification { u16 status; }; -struct fence { - u32 hw_chid; - u32 syncpt_val; -}; - /* contexts associated with a channel */ struct channel_ctx_gk20a { struct gr_ctx_desc *gr_ctx; diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index c645aeea..6c18c895 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1164,6 +1164,7 @@ static int gk20a_pm_unrailgate(struct generic_pm_domain *domain) return _gk20a_pm_unrailgate(platform->g->dev); } +#if 0 static int gk20a_pm_suspend(struct device *dev) { struct gk20a_platform *platform = dev_get_drvdata(dev); @@ -1188,6 +1189,7 @@ static int gk20a_pm_resume(struct device *dev) { return gk20a_pm_finalize_poweron(dev); } +#endif static int gk20a_pm_initialise_domain(struct platform_device *pdev) { @@ -1211,8 +1213,11 @@ static int gk20a_pm_initialise_domain(struct platform_device *pdev) domain->dev_ops.stop = gk20a_pm_disable_clk; domain->dev_ops.save_state = gk20a_pm_prepare_poweroff; domain->dev_ops.restore_state = gk20a_pm_finalize_poweron; +#warning domain suspend/resume ops have been removed upstream +#if 0 domain->dev_ops.suspend = gk20a_pm_suspend; domain->dev_ops.resume = gk20a_pm_resume; +#endif device_set_wakeup_capable(&pdev->dev, 0); ret = pm_genpd_add_device(domain, &pdev->dev); diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c index 42720307..7baadf2e 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c @@ -435,7 +435,7 @@ static ssize_t aelpg_param_read(struct device *device, g->pmu.aelpg_param[3], g->pmu.aelpg_param[4]); } -static DEVICE_ATTR(aelpg_param, S_IRWXUGO, +static DEVICE_ATTR(aelpg_param, ROOTRW, aelpg_param_read, aelpg_param_store); static ssize_t aelpg_enable_store(struct device *device, @@ -648,7 +648,7 @@ static ssize_t tpc_fs_mask_read(struct device *device, return sprintf(buf, "0x%x\n", tpc_fs_mask); } -static DEVICE_ATTR(tpc_fs_mask, S_IRWXUGO, tpc_fs_mask_read, tpc_fs_mask_store); +static DEVICE_ATTR(tpc_fs_mask, ROOTRW, tpc_fs_mask_read, tpc_fs_mask_store); void gk20a_remove_sysfs(struct device *dev) { diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index e9b39487..4d101845 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -580,7 +580,7 @@ int gr_gk20a_ctx_patch_write_begin(struct gk20a *g, ch_ctx->patch_ctx.cpu_va = vmap(ch_ctx->patch_ctx.pages, PAGE_ALIGN(ch_ctx->patch_ctx.size) >> PAGE_SHIFT, - 0, pgprot_dmacoherent(PAGE_KERNEL)); + 0, pgprot_writecombine(PAGE_KERNEL)); if (!ch_ctx->patch_ctx.cpu_va) return -ENOMEM; @@ -691,7 +691,7 @@ static int gr_gk20a_ctx_zcull_setup(struct gk20a *g, struct channel_gk20a *c, ctx_ptr = vmap(ch_ctx->gr_ctx->pages, PAGE_ALIGN(ch_ctx->gr_ctx->size) >> PAGE_SHIFT, - 0, pgprot_dmacoherent(PAGE_KERNEL)); + 0, pgprot_writecombine(PAGE_KERNEL)); if (!ctx_ptr) return -ENOMEM; @@ -1455,13 +1455,13 @@ static int gr_gk20a_init_golden_ctx_image(struct gk20a *g, gold_ptr = vmap(gr->global_ctx_buffer[GOLDEN_CTX].pages, PAGE_ALIGN(gr->global_ctx_buffer[GOLDEN_CTX].size) >> - PAGE_SHIFT, 0, pgprot_dmacoherent(PAGE_KERNEL)); + PAGE_SHIFT, 0, pgprot_writecombine(PAGE_KERNEL)); if (!gold_ptr) goto clean_up; ctx_ptr = vmap(ch_ctx->gr_ctx->pages, PAGE_ALIGN(ch_ctx->gr_ctx->size) >> PAGE_SHIFT, - 0, pgprot_dmacoherent(PAGE_KERNEL)); + 0, pgprot_writecombine(PAGE_KERNEL)); if (!ctx_ptr) goto clean_up; @@ -1535,7 +1535,7 @@ int gr_gk20a_update_smpc_ctxsw_mode(struct gk20a *g, ctx_ptr = vmap(ch_ctx->gr_ctx->pages, PAGE_ALIGN(ch_ctx->gr_ctx->size) >> PAGE_SHIFT, - 0, pgprot_dmacoherent(PAGE_KERNEL)); + 0, pgprot_writecombine(PAGE_KERNEL)); if (!ctx_ptr) return -ENOMEM; @@ -1575,7 +1575,7 @@ int gr_gk20a_load_golden_ctx_image(struct gk20a *g, ctx_ptr = vmap(ch_ctx->gr_ctx->pages, PAGE_ALIGN(ch_ctx->gr_ctx->size) >> PAGE_SHIFT, - 0, pgprot_dmacoherent(PAGE_KERNEL)); + 0, pgprot_writecombine(PAGE_KERNEL)); if (!ctx_ptr) return -ENOMEM; @@ -4554,7 +4554,7 @@ static int gr_gk20a_init_access_map(struct gk20a *g) data = vmap(gr->global_ctx_buffer[PRIV_ACCESS_MAP].pages, PAGE_ALIGN(gr->global_ctx_buffer[PRIV_ACCESS_MAP].size) >> - PAGE_SHIFT, 0, pgprot_dmacoherent(PAGE_KERNEL)); + PAGE_SHIFT, 0, pgprot_writecombine(PAGE_KERNEL)); if (!data) { gk20a_err(dev_from_gk20a(g), "failed to map priv access map memory"); @@ -6970,7 +6970,7 @@ int gr_gk20a_exec_ctx_ops(struct channel_gk20a *ch, /* recoded in-place instead.*/ ctx_ptr = vmap(ch_ctx->gr_ctx->pages, PAGE_ALIGN(ch_ctx->gr_ctx->size) >> PAGE_SHIFT, - 0, pgprot_dmacoherent(PAGE_KERNEL)); + 0, pgprot_writecombine(PAGE_KERNEL)); if (!ctx_ptr) { err = -ENOMEM; goto cleanup; diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index e51ce7c5..75de063a 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -550,7 +550,7 @@ int map_gmmu_pages(void *handle, struct sg_table *sgt, *kva = handle; } else { pages = (struct page **)handle; - *kva = vmap(pages, count, 0, pgprot_dmacoherent(PAGE_KERNEL)); + *kva = vmap(pages, count, 0, pgprot_writecombine(PAGE_KERNEL)); if (!(*kva)) return -ENOMEM; } -- cgit v1.2.2