Commit 8e10ee9a authored by Adam Jackson's avatar Adam Jackson Committed by Dave Airlie

drm/edid: Fix CVT width/height decode

Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 69da3015
...@@ -920,18 +920,18 @@ static int drm_cvt_modes(struct drm_connector *connector, ...@@ -920,18 +920,18 @@ static int drm_cvt_modes(struct drm_connector *connector,
if (!memcmp(cvt->code, empty, 3)) if (!memcmp(cvt->code, empty, 3))
continue; continue;
height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 8) + 1) * 2; height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 4) + 1) * 2;
switch (cvt->code[1] & 0xc0) { switch (cvt->code[1] & 0x0c) {
case 0x00: case 0x00:
width = height * 4 / 3; width = height * 4 / 3;
break; break;
case 0x40: case 0x04:
width = height * 16 / 9; width = height * 16 / 9;
break; break;
case 0x80: case 0x08:
width = height * 16 / 10; width = height * 16 / 10;
break; break;
case 0xc0: case 0x0c:
width = height * 15 / 9; width = height * 15 / 9;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment