video: tegra: dc: update VIC identification
Naveen Kumar S [Thu, 26 Nov 2015 09:55:39 +0000 (14:55 +0530)]
Adding few more checks to help VIC identification.
Comparing 1001/1000 value of pixclock to take care of
pclk rounding-off issue. Also, comparing mode->flag value
helps in choosing the CEA mode with matching aspect ratio.

bug 200148145
bug 200145631
bug 1689283

Change-Id: Ia80ba4dd3337772b24b74ee355a1032d59b31d9d
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: http://git-master/r/838452
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
GVS: Gerrit_Virtual_Submit

drivers/video/tegra/dc/hdmi2.0.c

index 404f35d..4115874 100644 (file)
@@ -1158,7 +1158,8 @@ static int tegra_hdmi_find_cea_vic(struct tegra_hdmi *hdmi)
                       m.refresh == curr->refresh + 1) &&
                      m.xres         == curr->xres &&
                      m.yres         == curr->yres &&
-                     m.pixclock     == curr->pixclock &&
+                     (m.pixclock    == curr->pixclock ||
+                     (m.pixclock * 1001 / 1000) == curr->pixclock) &&
                      m.hsync_len    == curr->hsync_len &&
                      m.vsync_len    == curr->vsync_len &&
                      m.left_margin  == curr->left_margin &&
@@ -1166,6 +1167,7 @@ static int tegra_hdmi_find_cea_vic(struct tegra_hdmi *hdmi)
                      m.upper_margin == curr->upper_margin &&
                      m.lower_margin == curr->lower_margin &&
                      m.sync         == curr->sync &&
+                     m.flag         == curr->flag &&
                      m.vmode        == curr->vmode))
                        continue;