From f939885e6f77ac92bad278487ccf651f2256a7b0 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 22 Jan 2014 18:09:13 +0100 Subject: 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. --- drivers/video/tegra/dc/mode.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'drivers/video/tegra/dc/mode.c') 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) { -- cgit v1.2.3