summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-09-15 10:30:46 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:37:13 -0800
commit83adb17804d48ead8fc91a8ab7dda81db13b9444 (patch)
tree831d04adfcdbb46073fac303633599345c1e9011 /drivers
parent949e796a5a1ea149540adf576e2a11aa17712902 (diff)
video: fbmon: fixed E-EDID SVD entry parsing
Fixed index calculation when parsing E-EDID block SVD entry in fb_edid_add_monspecs(). Change-Id: I0273e2f29e86687607923d07faf99a30696f5ead Signed-off-by: Eric Laurent <elaurent@google.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/fbmon.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
index 08ae0da08075..f3fa4469dedc 100644
--- a/drivers/video/fbmon.c
+++ b/drivers/video/fbmon.c
@@ -986,7 +986,7 @@ void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)
/**
* fb_edid_add_monspecs() - add monitor video modes from E-EDID data
* @edid: 128 byte array with an E-EDID block
- * @spacs: monitor specs to be extended
+ * @specs: monitor specs to be extended
*/
void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
{
@@ -1011,21 +1011,23 @@ void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
while (pos < edid[2]) {
u8 len = edid[pos] & 0x1f, type = (edid[pos] >> 5) & 7;
pr_debug("Data block %u of %u bytes\n", type, len);
+
+ pos++;
if (type == 2) {
for (i = pos; i < pos + len; i++) {
- u8 idx = edid[pos + i] & 0x7f;
+ u8 idx = edid[i] & 0x7f;
svd[svd_n++] = idx;
pr_debug("N%sative mode #%d\n",
- edid[pos + i] & 0x80 ? "" : "on-n", idx);
+ edid[i] & 0x80 ? "" : "on-n", idx);
}
} else if (type == 3 && len >= 3) {
- u32 ieee_reg = edid[pos + 1] | (edid[pos + 2] << 8) |
- (edid[pos + 3] << 16);
+ u32 ieee_reg = edid[pos] | (edid[pos + 1] << 8) |
+ (edid[pos + 2] << 16);
if (ieee_reg == 0x000c03)
specs->misc |= FB_MISC_HDMI;
}
- pos += len + 1;
+ pos += len;
}
block = edid + edid[2];