drm/edid: Fix CVT width/height decode
authorAdam Jackson <ajax@redhat.com>
Mon, 4 Jan 2010 22:53:07 +0000 (17:53 -0500)
committerDave Airlie <airlied@redhat.com>
Thu, 7 Jan 2010 03:18:04 +0000 (13:18 +1000)
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_edid.c

index 7d6ac22..defcaf1 100644 (file)
@@ -920,18 +920,18 @@ static int drm_cvt_modes(struct drm_connector *connector,
                if (!memcmp(cvt->code, empty, 3))
                        continue;
 
-               height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 8) + 1) * 2;
-               switch (cvt->code[1] & 0xc0) {
+               height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 4) + 1) * 2;
+               switch (cvt->code[1] & 0x0c) {
                case 0x00:
                        width = height * 4 / 3;
                        break;
-               case 0x40:
+               case 0x04:
                        width = height * 16 / 9;
                        break;
-               case 0x80:
+               case 0x08:
                        width = height * 16 / 10;
                        break;
-               case 0xc0:
+               case 0x0c:
                        width = height * 15 / 9;
                        break;
                }