diff --git a/drivers/gpu/nvgpu/Kconfig b/drivers/gpu/nvgpu/Kconfig index 6797a7196..5ebb96e3e 100644 --- a/drivers/gpu/nvgpu/Kconfig +++ b/drivers/gpu/nvgpu/Kconfig @@ -12,14 +12,6 @@ config GK20A_DEFAULT_TIMEOUT help Default timeout for jobs in milliseconds. Set to zero for no timeout. -config GK20A_CDE - depends on GK20A - bool "Support compression bit switzzling through CDE" - default n - help - Say Y to allow compression bit swizzling - using pre-compiled shader. - config GK20A_PMU bool "Support GK20A PMU" depends on GK20A diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index 22a422a31..d9fe9ef18 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c @@ -879,16 +879,8 @@ int gk20a_cde_reload(struct gk20a *g) struct gk20a_cde_ctx *cde_ctx = cde_app->cde_ctx; int err, i; - if (!cde_app->initialised) { - err = gk20a_busy(g->dev); - if (err) - return err; - gk20a_init_cde_support(g); - gk20a_idle(g->dev); - if (!cde_app->initialised) - return -ENOSYS; - return 0; - } + if (!cde_app->initialised) + return -ENOSYS; err = gk20a_busy(g->dev); if (err) @@ -1044,11 +1036,8 @@ static int gk20a_buffer_convert_gpu_to_cde( const int gridw = roundup(xtiles, xalign) / xalign; const int gridh = roundup(ytiles, yalign) / yalign; - if (!g->cde_app.initialised) { - err = gk20a_cde_reload(g); - if (err) - return err; - } + if (!g->cde_app.initialised) + return -ENOSYS; if (xtiles > 4096 / 8 || ytiles > 4096 / 8) gk20a_warn(&g->dev->dev, "cde: surface is exceptionally large (xtiles=%d, ytiles=%d)", @@ -1087,16 +1076,12 @@ static int gk20a_buffer_convert_gpu_to_cde( err = gk20a_busy(g->dev); if (err) return err; - err = gk20a_init_cde_support(g); - if (err) - goto out; err = gk20a_cde_convert(g, dmabuf, 0, /* dst kind */ compbits_offset, 0, /* dst_size, 0 = auto */ fence_in, submit_flags, params, param, fence_out); -out: gk20a_idle(g->dev); return err; } diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 226b5ae3c..5dda7d745 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -798,6 +798,7 @@ static int gk20a_pm_finalize_poweron(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct gk20a *g = get_gk20a(pdev); + struct gk20a_platform *platform = gk20a_get_platform(pdev); int err, nice_value; gk20a_dbg_fn(""); @@ -939,7 +940,7 @@ static int gk20a_pm_finalize_poweron(struct device *dev) trace_gk20a_finalize_poweron_done(dev_name(dev)); - if (IS_ENABLED(CONFIG_GK20A_CDE)) + if (platform->has_cde) gk20a_init_cde_support(g); #ifdef CONFIG_INPUT_CFBOOST diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h index aada1537e..d5a1cc91f 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h @@ -160,6 +160,8 @@ struct gk20a_platform { u64 virt_handle; struct task_struct *intr_handler; #endif + + bool has_cde; }; static inline struct gk20a_platform *gk20a_get_platform( diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c index ccbf932ff..d75009291 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c @@ -543,4 +543,6 @@ struct gk20a_platform gm20b_tegra_platform = { .secure_alloc = gk20a_tegra_secure_alloc, .secure_page_alloc = gk20a_tegra_secure_page_alloc, .dump_platform_dependencies = gk20a_tegra_debug_dump, + + .has_cde = true, };