hdmitx: add 3d framepack mode support [1/1]
authorKaifu Hu <kaifu.hu@amlogic.com>
Mon, 28 Jan 2019 08:01:19 +0000 (16:01 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 14 Feb 2019 02:45:34 +0000 (18:45 -0800)
PD#SWPL-4233

Problem:
3D framepacking mode display black screen

Solution:
Add vinfo 3d flag and hdmitx update
when work 3d mode

Verify:
U212

Change-Id: Ia2b7b25c9ed401dbec2c487ea2a5c6cc1e0d8b8d
Signed-off-by: Kaifu Hu <kaifu.hu@amlogic.com>
drivers/amlogic/media/vout/hdmitx/hdmi_common/hdmi_parameters.c
drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c
drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/enc_cfg_hw.c
drivers/amlogic/media/vout/vout_serve/vout_serve.c
include/linux/amlogic/media/vout/vinfo.h

index cf5e192..286bd91 100644 (file)
@@ -2863,6 +2863,24 @@ struct vinfo_s *hdmi_get_valid_vinfo(char *mode)
                /* the string of mode contains char NF */
                memset(mode_, 0, sizeof(mode_));
                strncpy(mode_, mode, sizeof(mode_));
+
+               /* skip "f", 1080fp60hz -> 1080p60hz for 3d */
+               mode_[31] = '\0';
+               if (strstr(mode_, "fp")) {
+                       int i = 0;
+
+                       for (; mode_[i]; i++) {
+                               if ((mode_[i] == 'f') &&
+                                       (mode_[i + 1] == 'p')) {
+                                       do {
+                                               mode_[i] = mode_[i + 1];
+                                               i++;
+                                       } while (mode_[i]);
+                                       break;
+                               }
+                       }
+               }
+
                for (i = 0; i < sizeof(mode_); i++)
                        if (mode_[i] == 10)
                                mode_[i] = 0;
index af57040..d85302a 100644 (file)
@@ -3514,6 +3514,16 @@ static enum vmode_e hdmitx_validate_vmode(char *mode)
 
        if (info) {
                hdmitx_vinfo = info;
+               hdmitx_vinfo->info_3d = NON_3D;
+               if (hdmitx_device.flag_3dfp)
+                       hdmitx_vinfo->info_3d = FP_3D;
+
+               if (hdmitx_device.flag_3dtb)
+                       hdmitx_vinfo->info_3d = TB_3D;
+
+               if (hdmitx_device.flag_3dss)
+                       hdmitx_vinfo->info_3d = SS_3D;
+
                hdmitx_vinfo->vout_device = &hdmitx_vdev;
                return VMODE_HDMI;
        }
@@ -4285,6 +4295,10 @@ static int amhdmitx_device_init(struct hdmitx_dev *hdmi_dev)
         */
        hdmitx_device.hpdmode = 1;
 
+       hdmitx_device.flag_3dfp = 0;
+       hdmitx_device.flag_3dss = 0;
+       hdmitx_device.flag_3dtb = 0;
+
        if ((init_flag&INIT_FLAG_POWERDOWN) && (hdmitx_device.hpdmode == 2))
                hdmitx_device.mux_hpd_if_pin_high_flag = 0;
        else
index 5b7e207..9df42c2 100644 (file)
@@ -1543,7 +1543,7 @@ static const struct reg_s tvregs_3dfp_1080p60[] = {
 
        {P_ENCP_VIDEO_MODE, 0x4040,},
        {P_ENCP_VIDEO_MODE_ADV, 0x18,},
-       {P_ENCP_VIDEO_MAX_PXCNT, 0x897,},
+       {P_ENCP_VIDEO_MAX_PXCNT, 0xABD,},
        {P_ENCP_VIDEO_MAX_LNCNT, 0x8C9,},
        {P_ENCP_VIDEO_HAVON_BEGIN, 0xC0,},
        {P_ENCP_VIDEO_HAVON_END, 0x83F,},
@@ -1623,7 +1623,7 @@ static const struct reg_s tvregs_3dfp_1080p50[] = {
 
        {P_ENCP_VIDEO_MODE, 0x4040,},
        {P_ENCP_VIDEO_MODE_ADV, 0x18,},
-       {P_ENCP_VIDEO_MAX_PXCNT, 0xA4F,},
+       {P_ENCP_VIDEO_MAX_PXCNT, 0xABD,},
        {P_ENCP_VIDEO_MAX_LNCNT, 0x8C9,},
        {P_ENCP_VIDEO_HAVON_BEGIN, 0xC0,},
        {P_ENCP_VIDEO_HAVON_END, 0x83F,},
index 0e42502..abb27c1 100644 (file)
@@ -489,14 +489,16 @@ static ssize_t vout_vinfo_show(struct class *class,
                "    fr_adj_type:           %d\n"
                "    video_clk:             %d\n"
                "    viu_color_fmt:         %d\n"
-               "    viu_mux:               %d\n\n",
+               "    viu_mux:               %d\n"
+               "    3d_info:               %d\n\n",
                info->name, info->mode,
                info->width, info->height, info->field_height,
                info->aspect_ratio_num, info->aspect_ratio_den,
                info->sync_duration_num, info->sync_duration_den,
                info->screen_real_width, info->screen_real_height,
                info->htotal, info->vtotal, info->fr_adj_type,
-               info->video_clk, info->viu_color_fmt, info->viu_mux);
+               info->video_clk, info->viu_color_fmt, info->viu_mux,
+               info->info_3d);
        len += sprintf(buf+len, "master_display_info:\n"
                "    present_flag          %d\n"
                "    features              0x%x\n"
@@ -547,6 +549,7 @@ static ssize_t vout_vinfo_show(struct class *class,
                info->hdr_info.hdr10plus_info.ieeeoui);
        len += sprintf(buf+len, "    application_version: %x\n",
                info->hdr_info.hdr10plus_info.application_version);
+
        return len;
 }
 
index 8a5720f..96cbf12 100644 (file)
@@ -53,6 +53,13 @@ enum vout_fr_adj_type_e {
        VOUT_FR_ADJ_MAX,
 };
 
+enum vinfo_3d_e {
+       NON_3D = 0,
+       SS_3D,
+       FP_3D,
+       TB_3D,
+};
+
 /*emp : extended metadata type*/
 #define VENDOR_SPECIFIC_EM_DATA 0x0
 #define COMPRESS_VIDEO_TRAMSPORT 0x1
@@ -258,6 +265,7 @@ struct vinfo_s {
        u32 video_clk;
        u32 htotal;
        u32 vtotal;
+       enum vinfo_3d_e info_3d;
        enum vout_fr_adj_type_e fr_adj_type;
        enum color_fmt_e viu_color_fmt;
        enum viu_mux_e viu_mux;