summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc/mode.c
diff options
context:
space:
mode:
authorIlan Aelion <iaelion@nvidia.com>2012-06-27 18:58:11 -0600
committerLokesh Pathak <lpathak@nvidia.com>2012-07-30 08:37:00 -0700
commite402db9b3737209c9981aea5970328d7c1cb06ce (patch)
tree245efed1639bfb099649c6d81263ea1a7e752cd9 /drivers/video/tegra/dc/mode.c
parent8055acfa05c82997bdcfbce5093b9cd963251d2a (diff)
misc: tegra-throughput: adding throughput dev node
Creates a miscdev at /dev/tegra-throughput which gl will use to set a target frame rate. In addition it receives notifications from dc on flip events. On each notification the percentage ratio of the actual frame time to the target frame time is calculated. In subsequent changes this ratio will be reported to other modules as a throughput hint. Bug 991589 Change-Id: Ieaa2b2755b63d2d071de31e3ef819d4c3b51a956 Signed-off-by: Ilan Aelion <iaelion@nvidia.com> Reviewed-on: http://git-master/r/116865 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc/mode.c')
-rw-r--r--drivers/video/tegra/dc/mode.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/video/tegra/dc/mode.c b/drivers/video/tegra/dc/mode.c
index 49cc5f5abd53..be909691b957 100644
--- a/drivers/video/tegra/dc/mode.c
+++ b/drivers/video/tegra/dc/mode.c
@@ -247,10 +247,23 @@ int tegra_dc_program_mode(struct tegra_dc *dc, struct tegra_dc_mode *mode)
return 0;
}
+static int panel_sync_rate;
+
+int tegra_dc_get_panel_sync_rate(void)
+{
+ return panel_sync_rate;
+}
+EXPORT_SYMBOL(tegra_dc_get_panel_sync_rate);
+
int tegra_dc_set_mode(struct tegra_dc *dc, const struct tegra_dc_mode *mode)
{
memcpy(&dc->mode, mode, sizeof(dc->mode));
+ if (dc->out->type == TEGRA_DC_OUT_RGB)
+ panel_sync_rate = tegra_dc_calc_refresh(mode);
+ else if (dc->out->type == TEGRA_DC_OUT_DSI)
+ panel_sync_rate = dc->out->dsi->rated_refresh_rate * 1000;
+
print_mode(dc, mode, __func__);
return 0;