diff options
author | Raghavendra VK <rvk@nvidia.com> | 2012-08-03 21:25:43 -0700 |
---|---|---|
committer | Lokesh Pathak <lpathak@nvidia.com> | 2012-08-21 05:37:09 -0700 |
commit | e4e2e776a3d4bf1adf37fc061cfdfb92281f3ace (patch) | |
tree | 702feb9db306273fa53aab678f18abd8e3354816 /drivers/video/tegra/dc/mode.c | |
parent | 1c9102f23b9140a045e2be4dc80735f1268b7961 (diff) |
video: tegra: dc: Add timestamp support
bug 1021221
Change-Id: Ifbe007de5bdeafaa15a0b3f2a138086045eba160
Signed-off-by: Raghavendra VK <rvk@nvidia.com>
Reviewed-on: http://git-master/r/118179
(cherry picked from commit 74be8d4e7210d7bcea0d55565a7cbb06d6cc960e)
Reviewed-on: http://git-master/r/121087
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc/mode.c')
-rw-r--r-- | drivers/video/tegra/dc/mode.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/video/tegra/dc/mode.c b/drivers/video/tegra/dc/mode.c index be909691b957..45cfe8dbd188 100644 --- a/drivers/video/tegra/dc/mode.c +++ b/drivers/video/tegra/dc/mode.c @@ -137,6 +137,16 @@ static bool check_ref_to_sync(struct tegra_dc_mode *mode) return true; } +static s64 calc_frametime_ns(const struct tegra_dc_mode *m) +{ + long h_total, v_total; + h_total = m->h_active + m->h_front_porch + m->h_back_porch + + 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 in 1000ths of a Hertz */ int tegra_dc_calc_refresh(const struct tegra_dc_mode *m) { @@ -265,6 +275,7 @@ int tegra_dc_set_mode(struct tegra_dc *dc, const struct tegra_dc_mode *mode) panel_sync_rate = dc->out->dsi->rated_refresh_rate * 1000; print_mode(dc, mode, __func__); + dc->frametime_ns = calc_frametime_ns(mode); return 0; } |