summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/Kconfig8
-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
5 files changed, 10 insertions, 28 deletions
diff --git a/drivers/gpu/nvgpu/Kconfig b/drivers/gpu/nvgpu/Kconfig
index 6797a719..5ebb96e3 100644
--- a/drivers/gpu/nvgpu/Kconfig
+++ b/drivers/gpu/nvgpu/Kconfig
@@ -12,14 +12,6 @@ config GK20A_DEFAULT_TIMEOUT
12 help 12 help
13 Default timeout for jobs in milliseconds. Set to zero for no timeout. 13 Default timeout for jobs in milliseconds. Set to zero for no timeout.
14 14
15config GK20A_CDE
16 depends on GK20A
17 bool "Support compression bit switzzling through CDE"
18 default n
19 help
20 Say Y to allow compression bit swizzling
21 using pre-compiled shader.
22
23config GK20A_PMU 15config GK20A_PMU
24 bool "Support GK20A PMU" 16 bool "Support GK20A PMU"
25 depends on GK20A 17 depends on GK20A
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};