summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2014-10-23 07:17:52 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:55 -0400
commit8c5b39353e7353b358c0da9d0de8691922e1179d (patch)
tree636e8bec07230737d5c5df525259fbde5af4e4bb /drivers/gpu/nvgpu/gk20a
parent2d5ff668cbc6a932df2c9cf79627d1d340e5c2c0 (diff)
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>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/cde_gk20a.c23
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c3
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a.h2
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c2
4 files changed, 10 insertions, 20 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
index 22a422a3..d9fe9ef1 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)
879 struct gk20a_cde_ctx *cde_ctx = cde_app->cde_ctx; 879 struct gk20a_cde_ctx *cde_ctx = cde_app->cde_ctx;
880 int err, i; 880 int err, i;
881 881
882 if (!cde_app->initialised) { 882 if (!cde_app->initialised)
883 err = gk20a_busy(g->dev); 883 return -ENOSYS;
884 if (err)
885 return err;
886 gk20a_init_cde_support(g);
887 gk20a_idle(g->dev);
888 if (!cde_app->initialised)
889 return -ENOSYS;
890 return 0;
891 }
892 884
893 err = gk20a_busy(g->dev); 885 err = gk20a_busy(g->dev);
894 if (err) 886 if (err)
@@ -1044,11 +1036,8 @@ static int gk20a_buffer_convert_gpu_to_cde(
1044 const int gridw = roundup(xtiles, xalign) / xalign; 1036 const int gridw = roundup(xtiles, xalign) / xalign;
1045 const int gridh = roundup(ytiles, yalign) / yalign; 1037 const int gridh = roundup(ytiles, yalign) / yalign;
1046 1038
1047 if (!g->cde_app.initialised) { 1039 if (!g->cde_app.initialised)
1048 err = gk20a_cde_reload(g); 1040 return -ENOSYS;
1049 if (err)
1050 return err;
1051 }
1052 1041
1053 if (xtiles > 4096 / 8 || ytiles > 4096 / 8) 1042 if (xtiles > 4096 / 8 || ytiles > 4096 / 8)
1054 gk20a_warn(&g->dev->dev, "cde: surface is exceptionally large (xtiles=%d, ytiles=%d)", 1043 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(
1087 err = gk20a_busy(g->dev); 1076 err = gk20a_busy(g->dev);
1088 if (err) 1077 if (err)
1089 return err; 1078 return err;
1090 err = gk20a_init_cde_support(g);
1091 if (err)
1092 goto out;
1093 err = gk20a_cde_convert(g, dmabuf, 1079 err = gk20a_cde_convert(g, dmabuf,
1094 0, /* dst kind */ 1080 0, /* dst kind */
1095 compbits_offset, 1081 compbits_offset,
1096 0, /* dst_size, 0 = auto */ 1082 0, /* dst_size, 0 = auto */
1097 fence_in, submit_flags, 1083 fence_in, submit_flags,
1098 params, param, fence_out); 1084 params, param, fence_out);
1099out:
1100 gk20a_idle(g->dev); 1085 gk20a_idle(g->dev);
1101 return err; 1086 return err;
1102} 1087}
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 226b5ae3..5dda7d74 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)
798{ 798{
799 struct platform_device *pdev = to_platform_device(dev); 799 struct platform_device *pdev = to_platform_device(dev);
800 struct gk20a *g = get_gk20a(pdev); 800 struct gk20a *g = get_gk20a(pdev);
801 struct gk20a_platform *platform = gk20a_get_platform(pdev);
801 int err, nice_value; 802 int err, nice_value;
802 803
803 gk20a_dbg_fn(""); 804 gk20a_dbg_fn("");
@@ -939,7 +940,7 @@ static int gk20a_pm_finalize_poweron(struct device *dev)
939 940
940 trace_gk20a_finalize_poweron_done(dev_name(dev)); 941 trace_gk20a_finalize_poweron_done(dev_name(dev));
941 942
942 if (IS_ENABLED(CONFIG_GK20A_CDE)) 943 if (platform->has_cde)
943 gk20a_init_cde_support(g); 944 gk20a_init_cde_support(g);
944 945
945#ifdef CONFIG_INPUT_CFBOOST 946#ifdef CONFIG_INPUT_CFBOOST
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
index aada1537..d5a1cc91 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
@@ -160,6 +160,8 @@ struct gk20a_platform {
160 u64 virt_handle; 160 u64 virt_handle;
161 struct task_struct *intr_handler; 161 struct task_struct *intr_handler;
162#endif 162#endif
163
164 bool has_cde;
163}; 165};
164 166
165static inline struct gk20a_platform *gk20a_get_platform( 167static 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 ccbf932f..d7500929 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 = {
543 .secure_alloc = gk20a_tegra_secure_alloc, 543 .secure_alloc = gk20a_tegra_secure_alloc,
544 .secure_page_alloc = gk20a_tegra_secure_page_alloc, 544 .secure_page_alloc = gk20a_tegra_secure_page_alloc,
545 .dump_platform_dependencies = gk20a_tegra_debug_dump, 545 .dump_platform_dependencies = gk20a_tegra_debug_dump,
546
547 .has_cde = true,
546}; 548};