video: tegra: dc: flag modes failing constraints
Ivan Raul Guadarrama [Tue, 8 Dec 2015 14:44:06 +0000 (16:44 +0200)]
-Create the new FB_VMODE_ADJUSTED flag to detect modes
 which fail tegra dc programming constraints and have
 been adjusted by the driver.
-Propagate such flag to userspace.

Bug 1691633
Bug 1689283

Change-Id: I0794c957f2ac821a8747c929aeda82455538cb54
Signed-off-by: Ivan Raul Guadarrama <iguadarrama@nvidia.com>
Reviewed-on: http://git-master/r/933883
GVS: Gerrit_Virtual_Submit
Reviewed-by: Tuomas Kulve <tkulve@nvidia.com>
Reviewed-by: Santosh Galma <galmar@nvidia.com>
Reviewed-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>

drivers/video/tegra/dc/dp.c
drivers/video/tegra/dc/hdmi.c
drivers/video/tegra/dc/hdmi2.0.c
include/uapi/linux/fb.h

index 1e0e874..2e986a6 100644 (file)
@@ -2663,6 +2663,7 @@ static bool tegra_dp_mode_filter(const struct tegra_dc *dc,
        if (mode->lower_margin == 1) {
                mode->lower_margin++;
                mode->upper_margin--;
+               mode->vmode |= FB_VMODE_ADJUSTED;
        }
 
        if (!tegra_dp_check_dc_constraint(mode))
index 8287225..68ddb7c 100644 (file)
@@ -953,6 +953,7 @@ bool tegra_dc_hdmi_mode_filter(const struct tegra_dc *dc,
        if (mode->lower_margin == 1) {
                mode->lower_margin++;
                mode->upper_margin--;
+               mode->vmode |= FB_VMODE_ADJUSTED;
        }
 
        /* even after fix-ups the mode still isn't supported */
index e2c4b83..75f95d7 100644 (file)
@@ -356,6 +356,7 @@ static bool tegra_hdmi_fb_mode_filter(const struct tegra_dc *dc,
        if (mode->lower_margin == 1) {
                mode->lower_margin++;
                mode->upper_margin--;
+               mode->vmode |= FB_VMODE_ADJUSTED;
        }
 
        if (!tegra_hdmi_check_dc_constraint(mode))
index daeeb94..c821d23 100644 (file)
@@ -303,6 +303,7 @@ struct fb_bitfield {
 #define FB_VMODE_IS_DETAILED   0x200000
 #define FB_VMODE_IS_CEA                0x400000
 #define FB_VMODE_IS_HDMI_EXT 0x800000
+#define FB_VMODE_ADJUSTED      0x000080 /* adj to meet timing restrictions */
 
 #define FB_VMODE_MASK          0xe3ffff