gpu: nvgpu: cde: move GK20A_CDE to platform data

CONFIG_GK20A_CDE has not even been used for enabling CDE, just for
initializing it at boot time, and it was disabled; initialization has
been done late when the engine is first used. Remove the config
setting and add information about CDE support in gk20a platform data,
forcing the initialization at boot time. Boot time init removes rare
race conditions when CDE would be initialized by first user.

Bug 200046882

Change-Id: I85d5fb73dc27acbbe203138d25f6e342de030d93
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/562855
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Konsta Holtta
2014-10-23 14:17:52 +03:00
committed by Dan Willemsen
parent 2d5ff668cb
commit 8c5b39353e
5 changed files with 10 additions and 28 deletions

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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(

View File

@@ -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,
};