video: rockchip: hdmi: add new hdmi resolution mode support for discrete vr device.
authorwenping.zhang <wenping.zhang@rock-chips.com>
Mon, 29 Aug 2016 01:19:58 +0000 (09:19 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 31 Aug 2016 01:46:27 +0000 (09:46 +0800)
For some special hdmi pixclock we should add support for this clock in hdmi phy mpll table.

Add new format SUPPORT_RK_DISCRETE_VR for rockchip discrete vr device,if hdmi device
is rockchip discrete vr device, please set the vic = HDMI_VIDEO_DISCRETE_VR in hdmi timing.

Change-Id: I820f967a84fbb7737cd9e1c2951b89df63863298
Signed-off-by: wenping.zhang <wenping.zhang@rock-chips.com>
drivers/video/rockchip/hdmi/rockchip-hdmi-core.c
drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c
drivers/video/rockchip/hdmi/rockchip-hdmi.h
drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c
drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c [changed mode: 0755->0644]

index ece097f6054aca0bbd3ba248892f57caec4b70bf..bd490b09a323e56eb86abe5a694a2855a510bb16 100644 (file)
@@ -131,7 +131,7 @@ static void hdmi_wq_set_video(struct hdmi *hdmi)
        else
                video->color_input = HDMI_COLOR_RGB_0_255;
 
-       if (hdmi->vic & HDMI_VIDEO_DMT) {
+       if ((hdmi->vic & HDMI_VIDEO_DMT) || (hdmi->vic & HDMI_VIDEO_DISCRETE_VR)) {
                video->vic = hdmi->vic;
                video->color_output_depth = 8;
        } else {
index db6d0a4b6f31daf871b4fd9ecc886a5b425fe637..957d68d6682ca049f3d7744aefefb4433a4b6771 100644 (file)
@@ -771,6 +771,50 @@ static const struct hdmi_video_timing hdmi_mode[] = {
                .pixelrepeat = 1,
                .interface = OUT_P888,
        },
+       {
+               .mode = {
+                       .name = "1440x1280@60Hz",
+                       .refresh = 60,
+                       .xres = 1440,
+                       .yres = 1280,
+                       .pixclock = 148500000,
+                       .left_margin = 84,
+                       .right_margin = 360,
+                       .upper_margin = 8,
+                       .lower_margin = 10,
+                       .hsync_len = 20,
+                       .vsync_len = 2,
+                       .sync = 0,
+                       .vmode = 0,
+                       .flag = 0,
+               },
+               .vic = HDMI_VIDEO_DISCRETE_VR | 1,
+               .vic_2nd = 0,
+               .pixelrepeat = 1,
+               .interface = OUT_P888,
+       },
+       {
+               .mode = {
+                       .name = "1440x2560@60Hz",
+                       .refresh = 60,
+                       .xres = 1440,
+                       .yres = 2560,
+                       .pixclock = 269390000,
+                       .left_margin = 80,
+                       .right_margin = 180,
+                       .upper_margin = 7,
+                       .lower_margin = 7,
+                       .hsync_len = 40,
+                       .vsync_len = 6,
+                       .sync = 0,
+                       .vmode = 0,
+                       .flag = 0,
+               },
+               .vic = HDMI_VIDEO_DISCRETE_VR | 2,
+               .vic_2nd = 0,
+               .pixelrepeat = 1,
+               .interface = OUT_P888,
+       },
 };
 
 static int hdmi_set_info(struct rk_screen *screen, struct hdmi *hdmi)
@@ -784,7 +828,7 @@ static int hdmi_set_info(struct rk_screen *screen, struct hdmi *hdmi)
        if (hdmi->vic == 0)
                hdmi->vic = hdmi->property->defaultmode;
 
-       if (hdmi->vic & HDMI_VIDEO_DMT)
+       if ((hdmi->vic & HDMI_VIDEO_DMT) || (hdmi->vic & HDMI_VIDEO_DISCRETE_VR))
                vic = hdmi->vic;
        else
                vic = hdmi->vic & HDMI_VIC_MASK;
@@ -1074,8 +1118,8 @@ static void hdmi_sort_modelist(struct hdmi_edid *edid, int feature)
                modelist = list_entry(pos, struct display_modelist, list);
                /*pr_info("%s vic %d\n", __function__, modelist->vic);*/
                for (i = 0; i < ARRAY_SIZE(hdmi_mode); i++) {
-                       if (modelist->vic & HDMI_VIDEO_DMT) {
-                               if (feature & SUPPORT_VESA_DMT)
+                       if ((modelist->vic & HDMI_VIDEO_DMT) || (modelist->vic & HDMI_VIDEO_DISCRETE_VR)) {
+                               if (feature & (SUPPORT_VESA_DMT | SUPPORT_RK_DISCRETE_VR))
                                        vic = modelist->vic;
                                else
                                        continue;
@@ -1219,7 +1263,8 @@ int hdmi_ouputmode_select(struct hdmi *hdmi, int edid_ok)
                                if (mode->xres > 3840 ||
                                    mode->refresh < 50 ||
                                    (mode->vmode & FB_VMODE_INTERLACED) ||
-                                   hdmi_mode[i].vic & HDMI_VIDEO_DMT)
+                                   hdmi_mode[i].vic & HDMI_VIDEO_DMT ||
+                                   hdmi_mode[i].vic & HDMI_VIDEO_DISCRETE_VR)
                                        continue;
                        }
                        if ((feature & SUPPORT_TMDS_600M) == 0 &&
@@ -1319,7 +1364,7 @@ const struct fb_videomode *hdmi_vic_to_videomode(int vic)
 
        if (vic == 0)
                return NULL;
-       else if (vic & HDMI_VIDEO_DMT)
+       else if ((vic & HDMI_VIDEO_DMT) || (vic & HDMI_VIDEO_DISCRETE_VR))
                vid = vic;
        else
                vid = vic & HDMI_VIC_MASK;
@@ -1346,7 +1391,7 @@ void hdmi_init_modelist(struct hdmi *hdmi)
        feature = hdmi->property->feature;
        INIT_LIST_HEAD(&hdmi->edid.modelist);
        for (i = 0; i < ARRAY_SIZE(hdmi_mode); i++) {
-               if (hdmi_mode[i].vic & HDMI_VIDEO_DMT)
+               if ((hdmi_mode[i].vic & HDMI_VIDEO_DMT) || (hdmi_mode[i].vic & HDMI_VIDEO_DISCRETE_VR))
                        continue;
                if ((feature & SUPPORT_TMDS_600M) == 0 &&
                    hdmi_mode[i].mode.pixclock > 340000000)
index e514031890c35c08fb078b16dbf102eb8cd88bc2..a5e8dd54808088952c81e3e58aae43d1e3abe541 100644 (file)
@@ -12,6 +12,7 @@
 #define HDMI_VIDEO_NORMAL                              0
 #define HDMI_VIDEO_DMT                                 BIT(9)
 #define HDMI_VIDEO_YUV420                              BIT(10)
+#define HDMI_VIDEO_DISCRETE_VR                         BIT(11)
 #define HDMI_VIC_MASK                                  (0xFF)
 #define HDMI_TYPE_MASK                                 (0xFF << 8)
 #define HDMI_MAX_ID                                    4
@@ -359,7 +360,8 @@ enum rk_hdmi_feature {
        SUPPORT_HDCP            =       (1 << 10),
        SUPPORT_HDCP2           =       (1 << 11),
        SUPPORT_YCBCR_INPUT     =       (1 << 12),
-       SUPPORT_VESA_DMT        =       (1 << 13)
+       SUPPORT_VESA_DMT        =       (1 << 13),
+       SUPPORT_RK_DISCRETE_VR  =       (1 << 14)
 };
 
 struct hdmi_property {
index 2510374e1699dd64358edbc563ee83b2a39037e1..6e607a27d993c222e524ddd19b746826546ff385 100644 (file)
@@ -617,7 +617,8 @@ static int rockchip_hdmiv2_probe(struct platform_device *pdev)
                                SUPPORT_YCBCR_INPUT |
                                SUPPORT_1080I |
                                SUPPORT_480I_576I |
-                               SUPPORT_VESA_DMT;
+                               SUPPORT_VESA_DMT |
+                               SUPPORT_RK_DISCRETE_VR;
                if (rk_hdmi_property.videosrc == DISPLAY_SOURCE_LCDC0)
                        rk_hdmi_property.feature |=
                                                SUPPORT_4K |
old mode 100755 (executable)
new mode 100644 (file)
index 3db85bc..e4e812f
@@ -73,6 +73,8 @@ static const struct phy_mpll_config_tab PHY_MPLL_TABLE[] = {
                1,      1,      0,      0,      0,      0,      3},
        {148500000,     594000000,      0,      8,      0,      3,      1,
                1,      3,      0,      0,      0,      0,      3},
+       {269390000,     269390000,      0,      8,      0,      0,      0,
+               1,      0,      0,      0,      0,      0,      3},
        {297000000,     148500000,      0,      8,      0,      0,      0,
                1,      0,      1,      0,      0,      0,      3},
        {297000000,     297000000,      0,      8,      0,      0,      0,
@@ -1536,7 +1538,8 @@ static void hdmi_dev_config_avi(struct hdmi_dev *hdmi_dev,
        /* Set AVI infoFrame Data byte4 */
        if ((vpara->vic > 92 && vpara->vic < 96) ||
            (vpara->vic == 98) ||
-           (vpara->vic & HDMI_VIDEO_DMT))
+           (vpara->vic & HDMI_VIDEO_DMT) ||
+           (vpara->vic & HDMI_VIDEO_DISCRETE_VR))
                hdmi_writel(hdmi_dev, FC_AVIVID, 0);
        else
                hdmi_writel(hdmi_dev, FC_AVIVID, vpara->vic & 0xff);