diff options
author | Raghavendra VK <rvk@nvidia.com> | 2012-08-27 11:00:12 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 01:25:58 -0700 |
commit | c5bfaff39dee6a5e3b7f50128e315fdea4e278f6 (patch) | |
tree | 9e06046eaa5334d96ef8b10c3755cf480298f316 /drivers | |
parent | 7205115e3241507b1c1d9e7fb58af589ac788def (diff) |
tegra: dc: Fix div by zero in frame time computation.
- Set frame duration to 0 in NULL modeset.
bug 1039104
Change-Id: I2b7d5a8a7c1748d8d582505946014e002326cbee
Signed-off-by: Raghavendra VK <rvk@nvidia.com>
Reviewed-on: http://git-master/r/127603
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Rebase-Id: R46793c4eae68c60a976767ef7b5f8b4ebe5194a7
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/tegra/dc/dc.c | 2 | ||||
-rw-r--r-- | drivers/video/tegra/dc/mode.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index d76064b1617c..ef33dcf42466 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -1351,11 +1351,13 @@ static void tegra_dc_continuous_irq(struct tegra_dc *dc, unsigned long status) /* XXX: Not sure if we limit look ahead to 1 frame */ bool tegra_dc_is_within_n_vsync(struct tegra_dc *dc, s64 ts) { + BUG_ON(!dc->frametime_ns); return ((ts - dc->frame_end_timestamp) < dc->frametime_ns); } bool tegra_dc_does_vsync_separate(struct tegra_dc *dc, s64 new_ts, s64 old_ts) { + BUG_ON(!dc->frametime_ns); return (((new_ts - old_ts) > dc->frametime_ns) || (div_s64((new_ts - dc->frame_end_timestamp), dc->frametime_ns) != div_s64((old_ts - dc->frame_end_timestamp), diff --git a/drivers/video/tegra/dc/mode.c b/drivers/video/tegra/dc/mode.c index 6a17e3e7e518..963ced66be4c 100644 --- a/drivers/video/tegra/dc/mode.c +++ b/drivers/video/tegra/dc/mode.c @@ -144,7 +144,8 @@ static s64 calc_frametime_ns(const struct tegra_dc_mode *m) m->h_sync_width; v_total = m->v_active + m->v_front_porch + m->v_back_porch + m->v_sync_width; - return (s64)(div_s64(((s64)h_total * v_total * 1000000000ULL), m->pclk)); + return (!m->pclk) ? 0 : (s64)(div_s64(((s64)h_total * v_total * + 1000000000ULL), m->pclk)); } /* return in 1000ths of a Hertz */ |