summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc/mode.c
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2014-01-22 18:09:13 +0100
committerStefan Agner <stefan.agner@toradex.com>2014-01-22 18:09:13 +0100
commitf939885e6f77ac92bad278487ccf651f2256a7b0 (patch)
tree9b01320f84134ca0eafa613c607c67e1cb857852 /drivers/video/tegra/dc/mode.c
parent3d8f44c100f23574e9a4a9c74fa6054e48ca53c2 (diff)
video: tegra: updated comments, move front_porch work around
Updated several comments to make code easier to read and understand. Also use the front_porch workaround in any case, for HDMI output too.
Diffstat (limited to 'drivers/video/tegra/dc/mode.c')
-rw-r--r--drivers/video/tegra/dc/mode.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/video/tegra/dc/mode.c b/drivers/video/tegra/dc/mode.c
index 0a0e730ad174..be0d2bc5f035 100644
--- a/drivers/video/tegra/dc/mode.c
+++ b/drivers/video/tegra/dc/mode.c
@@ -388,19 +388,22 @@ int tegra_dc_var_to_dc_mode(struct tegra_dc *dc, struct fb_var_screeninfo *var,
mode->h_front_porch = var->right_margin;
mode->v_front_porch = var->lower_margin;
mode->stereo_mode = stereo_mode;
+
+ /*
+ * HACK:
+ * If v_front_porch is only 1, we would violate Constraint 5/6
+ * in this case, increase front porch by 1
+ */
+ if (mode->v_front_porch <= 1)
+ mode->v_front_porch = 2;
+
+
if (dc->out->type == TEGRA_DC_OUT_HDMI) {
/* HDMI controller requires h_ref=1, v_ref=1 */
mode->h_ref_to_sync = 1;
mode->v_ref_to_sync = 1;
} else {
- /*
- * HACK:
- * If v_front_porch is only 1, we would violate Constraint 5/6
- * in this case, increase front porch by 1
- */
- if (mode->v_front_porch <= 1)
- mode->v_front_porch = 2;
-
+ /* Calculate ref_to_sync signals */
err = calc_ref_to_sync(mode);
if (err) {
dev_err(&dc->ndev->dev, "display timing ref_to_sync"
@@ -441,7 +444,10 @@ int tegra_dc_var_to_dc_mode(struct tegra_dc *dc, struct fb_var_screeninfo *var,
}
EXPORT_SYMBOL(tegra_dc_var_to_dc_mode);
-
+/*
+ * This method is only used by sysfs interface
+ * /sys/devices/tegradc.1/nvdps
+ */
int tegra_dc_set_fb_mode(struct tegra_dc *dc,
const struct fb_videomode *fbmode, bool stereo_mode)
{