summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorEmma Yan <eyan@nvidia.com>2013-09-30 21:39:14 +0800
committerMartin Chi <mchi@nvidia.com>2014-01-14 08:36:30 -0800
commitf87c591de9e5046ed6d8b1ae871be705cb435e0d (patch)
treea3fed0c6d48016cd9982b76b47659956d6dc4933 /drivers
parentd84e7b7804a0cf21d7ec6a2ded6054c932c5e15b (diff)
tegra: hdmi: support HDMI VSDB VIC parsing
Bug 1167856 Bug 1357380 Bug 1366416 Bug 1369156 Bug 1375947 (cherry picked from commit f649c7aded9902bbeb6e79423e1af87553441949) Reviewed-on: http://git-master/r/280300 Change-Id: Ifd2fce407405bed92d8c399c742635f6e9c59918 Signed-off-by: Emma Yan <eyan@nvidia.com> Reviewed-on: http://git-master/r/353721 GVS: Gerrit_Virtual_Submit Reviewed-by: Martin Chi <mchi@nvidia.com> Tested-by: Martin Chi <mchi@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/tegra/dc/edid.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/video/tegra/dc/edid.c b/drivers/video/tegra/dc/edid.c
index 3f3368c3a6a2..a56b6ac7f6e4 100644
--- a/drivers/video/tegra/dc/edid.c
+++ b/drivers/video/tegra/dc/edid.c
@@ -33,6 +33,8 @@ struct tegra_edid_pvt {
bool support_stereo;
bool support_underscan;
bool support_audio;
+ int hdmi_vic_len;
+ u8 hdmi_vic[7];
/* Note: dc_edid must remain the last member */
struct tegra_dc_edid dc_edid;
};
@@ -277,6 +279,13 @@ int tegra_edid_parse_ext_block(const u8 *raw, int idx,
/* 3D_present? */
if (j <= len && (ptr[j] & 0x80))
edid->support_stereo = 1;
+ /* HDMI_VIC_LEN */
+ if (++j <= len && (ptr[j] & 0xe0)) {
+ int k = 0;
+ edid->hdmi_vic_len = ptr[j] >> 5;
+ for (k = 0; k < edid->hdmi_vic_len; k++)
+ edid->hdmi_vic[k] = ptr[j+k+1];
+ }
}
}
if ((len > 5) &&
@@ -479,6 +488,30 @@ int tegra_edid_get_monspecs(struct tegra_edid *edid, struct fb_monspecs *specs)
#endif
}
}
+
+ if (new_data->hdmi_vic_len > 0) {
+ int k;
+ int l = specs->modedb_len;
+ struct fb_videomode *m;
+ m = kzalloc((specs->modedb_len + new_data->hdmi_vic_len) *
+ sizeof(struct fb_videomode), GFP_KERNEL);
+ if (!m)
+ break;
+ memcpy(m, specs->modedb, specs->modedb_len *
+ sizeof(struct fb_videomode));
+ for (k = 0; k < new_data->hdmi_vic_len; k++) {
+ unsigned vic = new_data->hdmi_vic[k];
+ if (vic >= HDMI_EXT_MODEDB_SIZE) {
+ pr_warning("Unsupported HDMI VIC %d, ignoring\n", vic);
+ continue;
+ }
+ memcpy(&m[l], &hdmi_ext_modes[vic], sizeof(m[l]));
+ l++;
+ }
+ kfree(specs->modedb);
+ specs->modedb = m;
+ specs->modedb_len = specs->modedb_len + new_data->hdmi_vic_len;
+ }
}
}