drm/edid: Add detailed block walk for VTB extensions
authorAdam Jackson <ajax@redhat.com>
Tue, 3 Aug 2010 18:38:18 +0000 (14:38 -0400)
committerDave Airlie <airlied@redhat.com>
Tue, 10 Aug 2010 00:46:58 +0000 (10:46 +1000)
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_edid.c

index 30b286ba16c4f05b8646ac555a9f98b13609541c..1bf81b91b70f1c860270505b940f5fa684250803 100644 (file)
@@ -711,6 +711,19 @@ cea_for_each_detailed_block(u8 *ext, detailed_cb *cb, void *closure)
                cb((struct detailed_timing *)(det_base + 18 * i), closure);
 }
 
+static void
+vtb_for_each_detailed_block(u8 *ext, detailed_cb *cb, void *closure)
+{
+       unsigned int i, n = min((int)ext[0x02], 6);
+       u8 *det_base = ext + 5;
+
+       if (ext[0x01] != 1)
+               return; /* unknown version */
+
+       for (i = 0; i < n; i++)
+               cb((struct detailed_timing *)(det_base + 18 * i), closure);
+}
+
 static void
 drm_for_each_detailed_block(u8 *raw_edid, detailed_cb *cb, void *closure)
 {
@@ -729,6 +742,9 @@ drm_for_each_detailed_block(u8 *raw_edid, detailed_cb *cb, void *closure)
                case CEA_EXT:
                        cea_for_each_detailed_block(ext, cb, closure);
                        break;
+               case VTB_EXT:
+                       vtb_for_each_detailed_block(ext, cb, closure);
+                       break;
                default:
                        break;
                }