Skip to content

Commit ef25bd8

Browse files
committed
Merge tag 'drm/for-3.12-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next
drm/tegra: Changes for v3.12-rc1 Only a couple of small patches this time around. These are mostly fixes for minor bugs that showed up, but there is also some preparatory work that will come in handy for future patches. * tag 'drm/for-3.12-rc1' of git://anongit.freedesktop.org/tegra/linux: drm/tegra: Parse device tree earlier gpu: host1x: Sort drivers by probe order gpu: host1x: Check for valid host1x pointer gpu: host1x: returning success instead of -ENOMEM gpu: host1x: fix an integer overflow check drm/tegra: hdmi: Make sure clock is enabled before dumping registers
2 parents f33bcab + 03da0e7 commit ef25bd8

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

drivers/gpu/host1x/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void host1x_set_drm_data(struct device *dev, void *data)
4343
void *host1x_get_drm_data(struct device *dev)
4444
{
4545
struct host1x *host1x = dev_get_drvdata(dev);
46-
return host1x->drm_data;
46+
return host1x ? host1x->drm_data : NULL;
4747
}
4848

4949
void host1x_sync_writel(struct host1x *host1x, u32 v, u32 r)

drivers/gpu/host1x/dev.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ static inline void host1x_hw_show_mlocks(struct host1x *host, struct output *o)
301301
host->debug_op->show_mlocks(host, o);
302302
}
303303

304-
extern struct platform_driver tegra_hdmi_driver;
305304
extern struct platform_driver tegra_dc_driver;
305+
extern struct platform_driver tegra_hdmi_driver;
306306
extern struct platform_driver tegra_gr2d_driver;
307307

308308
#endif

drivers/gpu/host1x/drm/hdmi.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,11 @@ static int tegra_hdmi_show_regs(struct seq_file *s, void *data)
888888
{
889889
struct drm_info_node *node = s->private;
890890
struct tegra_hdmi *hdmi = node->info_ent->data;
891+
int err;
892+
893+
err = clk_enable(hdmi->clk);
894+
if (err)
895+
return err;
891896

892897
#define DUMP_REG(name) \
893898
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)
10531058

10541059
#undef DUMP_REG
10551060

1061+
clk_disable(hdmi->clk);
1062+
10561063
return 0;
10571064
}
10581065

drivers/gpu/host1x/drm/rgb.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ int tegra_dc_rgb_probe(struct tegra_dc *dc)
147147
if (!rgb)
148148
return -ENOMEM;
149149

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+
150157
rgb->clk = devm_clk_get(dc->dev, NULL);
151158
if (IS_ERR(rgb->clk)) {
152159
dev_err(dc->dev, "failed to get clock\n");
@@ -165,13 +172,6 @@ int tegra_dc_rgb_probe(struct tegra_dc *dc)
165172
return err;
166173
}
167174

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-
175175
dc->rgb = &rgb->output;
176176

177177
return 0;

drivers/gpu/host1x/job.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ struct host1x_job *host1x_job_alloc(struct host1x_channel *ch,
4242

4343
/* Check that we're not going to overflow */
4444
total = sizeof(struct host1x_job) +
45-
num_relocs * sizeof(struct host1x_reloc) +
46-
num_unpins * sizeof(struct host1x_job_unpin_data) +
47-
num_waitchks * sizeof(struct host1x_waitchk) +
48-
num_cmdbufs * sizeof(struct host1x_job_gather) +
49-
num_unpins * sizeof(dma_addr_t) +
50-
num_unpins * sizeof(u32 *);
45+
(u64)num_relocs * sizeof(struct host1x_reloc) +
46+
(u64)num_unpins * sizeof(struct host1x_job_unpin_data) +
47+
(u64)num_waitchks * sizeof(struct host1x_waitchk) +
48+
(u64)num_cmdbufs * sizeof(struct host1x_job_gather) +
49+
(u64)num_unpins * sizeof(dma_addr_t) +
50+
(u64)num_unpins * sizeof(u32 *);
5151
if (total > ULONG_MAX)
5252
return NULL;
5353

@@ -466,9 +466,8 @@ static inline int copy_gathers(struct host1x_job *job, struct device *dev)
466466
&job->gather_copy,
467467
GFP_KERNEL);
468468
if (!job->gather_copy_mapped) {
469-
int err = PTR_ERR(job->gather_copy_mapped);
470469
job->gather_copy_mapped = NULL;
471-
return err;
470+
return -ENOMEM;
472471
}
473472

474473
job->gather_copy_size = size;

0 commit comments

Comments
 (0)