hdmi: edid: distinguish deep color mode between YCbCr444 and YCbCr420.
authorZheng Yang <zhengyang@rock-chips.com>
Mon, 8 Jun 2015 08:36:18 +0000 (16:36 +0800)
committerZheng Yang <zhengyang@rock-chips.com>
Mon, 8 Jun 2015 08:36:18 +0000 (16:36 +0800)
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
drivers/video/rockchip/hdmi/rockchip-hdmi-core.c
drivers/video/rockchip/hdmi/rockchip-hdmi-edid.c
drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c
drivers/video/rockchip/hdmi/rockchip-hdmi.h

index 56d7b8d65e9d5e7df3c18c61ad2de26094c45483..74a81483c032e971bedecd2f29fd5d0ed146041c 100644 (file)
@@ -74,12 +74,14 @@ static inline void hdmi_wq_set_audio(struct hdmi *hdmi)
 static void hdmi_wq_set_video(struct hdmi *hdmi)
 {
        struct hdmi_video       video;
+       int     deepcolor;
 
        DBG("%s", __func__);
 
        video.vic = hdmi->vic & HDMI_VIC_MASK;
        video.sink_hdmi = hdmi->edid.sink_hdmi;
        video.format_3d = hdmi->mode_3d;
+
        /* For DVI, output RGB */
        if (hdmi->edid.sink_hdmi == 0) {
                video.color_output = HDMI_COLOR_RGB_0_255;
@@ -95,16 +97,21 @@ static void hdmi_wq_set_video(struct hdmi *hdmi)
                        video.color_output = hdmi->colormode;
                }
        }
+       if (hdmi->vic & HDMI_VIDEO_YUV420) {
+               video.color_output = HDMI_COLOR_YCBCR420;
+               deepcolor = hdmi->edid.deepcolor_420;
+       } else {
+               deepcolor = hdmi->edid.deepcolor;
+       }
        if ((hdmi->property->feature & SUPPORT_DEEP_10BIT) &&
-           (hdmi->edid.deepcolor & HDMI_DEEP_COLOR_30BITS)) {
+           (deepcolor & HDMI_DEEP_COLOR_30BITS)) {
                if (hdmi->colordepth == HDMI_DEPP_COLOR_AUTO ||
                    hdmi->colordepth == 10)
                        video.color_output_depth = 10;
        } else {
                video.color_output_depth = 8;
        }
-       if (hdmi->vic & HDMI_VIDEO_YUV420)
-               video.color_output = HDMI_COLOR_YCBCR420;
+
        pr_info("hdmi output corlor mode is %d\n", video.color_output);
        video.color_input = HDMI_COLOR_RGB_0_255;
        if (hdmi->property->feature & SUPPORT_YCBCR_INPUT) {
index 87d0ccbd2e3e09df5fa71b2ed00cfbaab4c051d1..e18e98663f50878cee82c6e48f42ccb964edc192 100644 (file)
@@ -304,34 +304,26 @@ static int hdmi_edmi_parse_vsdb(unsigned char *buf, struct hdmi_edid *pedid,
                break;
        case 0xc45dd8:
                pedid->sink_hdmi = 1;
-               if (count > 4)
-                       pedid->hf_vsdb_version = buf[cur_offset + 4];
+               pedid->hf_vsdb_version = buf[cur_offset + 4];
                switch (pedid->hf_vsdb_version) {
                case 1:/*compliant with HDMI Specification 2.0*/
-                       if (count > 5) {
-                               pedid->maxtmdsclock =
-                                       buf[cur_offset + 5] * 5000000;
-                               EDBG("[CEA] maxtmdsclock is %d.\n",
-                                    pedid->maxtmdsclock);
-                       }
-                       if (count > 6) {
-                               pedid->scdc_present = buf[cur_offset+6] >> 7;
-                               pedid->rr_capable =
-                                       (buf[cur_offset+6]&0x40) >> 6;
-                               pedid->lte_340mcsc_scramble =
-                                       (buf[cur_offset+6]&0x08) >> 3;
-                               pedid->independent_view =
-                                       (buf[cur_offset+6]&0x04) >> 2;
-                               pedid->dual_view =
-                                       (buf[cur_offset+6]&0x02) >> 1;
-                               pedid->osd_disparity_3d =
-                                       buf[cur_offset+6] & 0x01;
-                       }
-                       if (count > 7) {
-                               pedid->deepcolor = buf[cur_offset+7]&0x7;
-                               EDBG("[CEA] deepcolor is %d.\n",
-                                    pedid->deepcolor);
-                       }
+                       pedid->maxtmdsclock =
+                               buf[cur_offset + 5] * 5000000;
+                       EDBG("[CEA] maxtmdsclock is %d.\n",
+                            pedid->maxtmdsclock);
+                       pedid->scdc_present = buf[cur_offset+6] >> 7;
+                       pedid->rr_capable =
+                               (buf[cur_offset+6]&0x40) >> 6;
+                       pedid->lte_340mcsc_scramble =
+                               (buf[cur_offset+6]&0x08) >> 3;
+                       pedid->independent_view =
+                               (buf[cur_offset+6]&0x04) >> 2;
+                       pedid->dual_view =
+                               (buf[cur_offset+6]&0x02) >> 1;
+                       pedid->osd_disparity_3d =
+                               buf[cur_offset+6] & 0x01;
+                       pedid->deepcolor_420 =
+                               (buf[cur_offset+7] & 0x7) << 1;
                        break;
                default:
                        pr_info("hf_vsdb_version = %d\n",
index af86044b315fae159ad5c1cc151bd6abbfe14bd3..33030dc14c51014601db537f7a39c0aa7f42013d 100644 (file)
@@ -351,7 +351,14 @@ static void hdmi_show_sink_info(struct hdmi *hdmi)
                pr_info("       36bit\n");
        if (hdmi->edid.deepcolor & HDMI_DEEP_COLOR_48BITS)
                pr_info("       48bit\n");
-
+       if (hdmi->edid.ycbcr420)
+               pr_info("       420_24bit\n");
+       if (hdmi->edid.deepcolor_420 & HDMI_DEEP_COLOR_30BITS)
+               pr_info("       420_30bit\n");
+       if (hdmi->edid.deepcolor_420 & HDMI_DEEP_COLOR_36BITS)
+               pr_info("       420_36bit\n");
+       if (hdmi->edid.deepcolor_420 & HDMI_DEEP_COLOR_48BITS)
+               pr_info("       420_48bit\n");
        pr_info("Support audio type:\n");
        for (i = 0; i < hdmi->edid.audio_num; i++) {
                audio = &(hdmi->edid.audio[i]);
index a47c38a9676b238f722f214a06d6001d84badb76..0f16d43ea779b0f19c3688fd7e6890cd9284d3b3 100644 (file)
@@ -272,6 +272,7 @@ struct hdmi_edid {
        unsigned char ycbcr420;         /*Display device support YCbCr420*/
        unsigned char deepcolor;        /*bit3:DC_48bit; bit2:DC_36bit;
                                          bit1:DC_30bit; bit0:DC_Y444;*/
+       unsigned char deepcolor_420;
        unsigned int  cecaddress;       /*CEC physical address*/
        unsigned int  maxtmdsclock;     /*Max supported tmds clock*/
        unsigned char fields_present;   /*bit7: latency