aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/host1x/dev.c2
-rw-r--r--drivers/gpu/host1x/dev.h2
-rw-r--r--drivers/gpu/host1x/drm/hdmi.c7
-rw-r--r--drivers/gpu/host1x/drm/rgb.c14
-rw-r--r--drivers/gpu/host1x/job.c15
5 files changed, 23 insertions, 17 deletions
diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
index 28e28a23d444..471630299878 100644
--- a/drivers/gpu/host1x/dev.c
+++ b/drivers/gpu/host1x/dev.c
@@ -43,7 +43,7 @@ void host1x_set_drm_data(struct device *dev, void *data)
43void *host1x_get_drm_data(struct device *dev) 43void *host1x_get_drm_data(struct device *dev)
44{ 44{
45 struct host1x *host1x = dev_get_drvdata(dev); 45 struct host1x *host1x = dev_get_drvdata(dev);
46 return host1x->drm_data; 46 return host1x ? host1x->drm_data : NULL;
47} 47}
48 48
49void host1x_sync_writel(struct host1x *host1x, u32 v, u32 r) 49void host1x_sync_writel(struct host1x *host1x, u32 v, u32 r)
diff --git a/drivers/gpu/host1x/dev.h b/drivers/gpu/host1x/dev.h
index 790ddf114e58..bed90a8131be 100644
--- a/drivers/gpu/host1x/dev.h
+++ b/drivers/gpu/host1x/dev.h
@@ -301,8 +301,8 @@ static inline void host1x_hw_show_mlocks(struct host1x *host, struct output *o)
301 host->debug_op->show_mlocks(host, o); 301 host->debug_op->show_mlocks(host, o);
302} 302}
303 303
304extern struct platform_driver tegra_hdmi_driver;
305extern struct platform_driver tegra_dc_driver; 304extern struct platform_driver tegra_dc_driver;
305extern struct platform_driver tegra_hdmi_driver;
306extern struct platform_driver tegra_gr2d_driver; 306extern struct platform_driver tegra_gr2d_driver;
307 307
308#endif 308#endif
diff --git a/drivers/gpu/host1x/drm/hdmi.c b/drivers/gpu/host1x/drm/hdmi.c
index 52e3c9641a0f..644d95c7d489 100644
--- a/drivers/gpu/host1x/drm/hdmi.c
+++ b/drivers/gpu/host1x/drm/hdmi.c
@@ -888,6 +888,11 @@ static int tegra_hdmi_show_regs(struct seq_file *s, void *data)
888{ 888{
889 struct drm_info_node *node = s->private; 889 struct drm_info_node *node = s->private;
890 struct tegra_hdmi *hdmi = node->info_ent->data; 890 struct tegra_hdmi *hdmi = node->info_ent->data;
891 int err;
892
893 err = clk_enable(hdmi->clk);
894 if (err)
895 return err;
891 896
892#define DUMP_REG(name) \ 897#define DUMP_REG(name) \
893 seq_printf(s, "%-56s %#05x %08lx\n", #name, name, \ 898 seq_printf(s, "%-56s %#05x %08lx\n", #name, name, \
@@ -1053,6 +1058,8 @@ static int tegra_hdmi_show_regs(struct seq_file *s, void *data)
1053 1058
1054#undef DUMP_REG 1059#undef DUMP_REG
1055 1060
1061 clk_disable(hdmi->clk);
1062
1056 return 0; 1063 return 0;
1057} 1064}
1058 1065
diff --git a/drivers/gpu/host1x/drm/rgb.c b/drivers/gpu/host1x/drm/rgb.c
index ed4416f20260..5aa66ef7a946 100644
--- a/drivers/gpu/host1x/drm/rgb.c
+++ b/drivers/gpu/host1x/drm/rgb.c
@@ -147,6 +147,13 @@ int tegra_dc_rgb_probe(struct tegra_dc *dc)
147 if (!rgb) 147 if (!rgb)
148 return -ENOMEM; 148 return -ENOMEM;
149 149
150 rgb->output.dev = dc->dev;
151 rgb->output.of_node = np;
152
153 err = tegra_output_parse_dt(&rgb->output);
154 if (err < 0)
155 return err;
156
150 rgb->clk = devm_clk_get(dc->dev, NULL); 157 rgb->clk = devm_clk_get(dc->dev, NULL);
151 if (IS_ERR(rgb->clk)) { 158 if (IS_ERR(rgb->clk)) {
152 dev_err(dc->dev, "failed to get clock\n"); 159 dev_err(dc->dev, "failed to get clock\n");
@@ -165,13 +172,6 @@ int tegra_dc_rgb_probe(struct tegra_dc *dc)
165 return err; 172 return err;
166 } 173 }
167 174
168 rgb->output.dev = dc->dev;
169 rgb->output.of_node = np;
170
171 err = tegra_output_parse_dt(&rgb->output);
172 if (err < 0)
173 return err;
174
175 dc->rgb = &rgb->output; 175 dc->rgb = &rgb->output;
176 176
177 return 0; 177 return 0;
diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c
index cc807667d8f1..c4e1050f2252 100644
--- a/drivers/gpu/host1x/job.c
+++ b/drivers/gpu/host1x/job.c
@@ -42,12 +42,12 @@ struct host1x_job *host1x_job_alloc(struct host1x_channel *ch,
42 42
43 /* Check that we're not going to overflow */ 43 /* Check that we're not going to overflow */
44 total = sizeof(struct host1x_job) + 44 total = sizeof(struct host1x_job) +
45 num_relocs * sizeof(struct host1x_reloc) + 45 (u64)num_relocs * sizeof(struct host1x_reloc) +
46 num_unpins * sizeof(struct host1x_job_unpin_data) + 46 (u64)num_unpins * sizeof(struct host1x_job_unpin_data) +
47 num_waitchks * sizeof(struct host1x_waitchk) + 47 (u64)num_waitchks * sizeof(struct host1x_waitchk) +
48 num_cmdbufs * sizeof(struct host1x_job_gather) + 48 (u64)num_cmdbufs * sizeof(struct host1x_job_gather) +
49 num_unpins * sizeof(dma_addr_t) + 49 (u64)num_unpins * sizeof(dma_addr_t) +
50 num_unpins * sizeof(u32 *); 50 (u64)num_unpins * sizeof(u32 *);
51 if (total > ULONG_MAX) 51 if (total > ULONG_MAX)
52 return NULL; 52 return NULL;
53 53
@@ -466,9 +466,8 @@ static inline int copy_gathers(struct host1x_job *job, struct device *dev)
466 &job->gather_copy, 466 &job->gather_copy,
467 GFP_KERNEL); 467 GFP_KERNEL);
468 if (!job->gather_copy_mapped) { 468 if (!job->gather_copy_mapped) {
469 int err = PTR_ERR(job->gather_copy_mapped);
470 job->gather_copy_mapped = NULL; 469 job->gather_copy_mapped = NULL;
471 return err; 470 return -ENOMEM;
472 } 471 }
473 472
474 job->gather_copy_size = size; 473 job->gather_copy_size = size;