video: rockchip: hdmi: fix HDMI CTS HF1-33
authorZheng Yang <zhengyang@rock-chips.com>
Mon, 18 Apr 2016 07:09:34 +0000 (15:09 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 6 Jan 2017 07:13:19 +0000 (15:13 +0800)
Accroding to CEA 861-F: When the Length field is set to L==1,
the Y420CMDB does not include a YCbCr 4:2:0 Capability Bit Map
and all the SVDs in the regular Video Data Block(s) support
YCbCr 4:2:0 sampling mode.

Change-Id: I6d0be6465d361c74ff72c79ef6f120910e2a74ff
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
drivers/video/rockchip/hdmi/rockchip-hdmi-edid.c

index 33b007148d86c1f9c74a5e8c1e8c8feb1c1d0dcb..b8c4b3949549b2cfbb459c2ecd5bf37296e7f4a7 100644 (file)
@@ -341,14 +341,23 @@ static void hdmi_edid_parse_yuv420cmdb(unsigned char *buf, int count,
        struct display_modelist *modelist;
        int i, j, yuv420_mask = 0, vic;
 
-       for (i = 0; i < count - 1; i++) {
-               EDBG("vic which support yuv420 mode is %x\n", buf[i]);
-               yuv420_mask |= buf[i] << (8 * i);
-       }
-       for (i = 0; i < 32; i++) {
-               if (yuv420_mask & (1 << i)) {
+       if (count == 1) {
+               list_for_each(pos, head) {
+                       modelist =
+                               list_entry(pos, struct display_modelist, list);
+                       vic = modelist->vic | HDMI_VIDEO_YUV420;
+                       hdmi_add_vic(vic, head);
+               }
+       } else {
+               for (i = 0; i < count - 1; i++) {
+                       EDBG("vic which support yuv420 mode is %x\n", buf[i]);
+                       yuv420_mask |= buf[i] << (8 * i);
+               }
+               for (i = 0; i < 32; i++) {
+                       if (!(yuv420_mask & (1 << i)))
+                               continue;
                        j = 0;
-                       for (pos = head->next; pos != (head); pos = pos->next) {
+                       list_for_each(pos, head) {
                                if (j++ == i) {
                                        modelist =
                                list_entry(pos, struct display_modelist, list);