vdin: for support dv ll mode [1/1]
authorYong Qin <yong.qin@amlogic.com>
Mon, 8 Jul 2019 07:42:57 +0000 (15:42 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Fri, 19 Jul 2019 01:46:33 +0000 (18:46 -0700)
PD#SWPL-2894

Problem:
vdin for support DV LL mode

Solution:
1.add dv 1.5 LL mode support
2.fix vdin mem dump method,only dump active zone
3.add support RGB and 12bit for dv LL mode
4.add vsi info param of dv LL mode
5.dolby vision LL 422 12bit mode,RX need to enable tunnel

Verify:
tl1

Change-Id: I4ddad1310bcc6d2f777bf7099ac26fe2db812b22
Signed-off-by: Yong Qin <yong.qin@amlogic.com>
15 files changed:
drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c
drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h
drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c
drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.h
drivers/amlogic/media/vin/tvin/tvin_frontend.h
drivers/amlogic/media/vin/tvin/tvin_global.h
drivers/amlogic/media/vin/tvin/vdin/vdin_ctl.c
drivers/amlogic/media/vin/tvin/vdin/vdin_ctl.h
drivers/amlogic/media/vin/tvin/vdin/vdin_debug.c
drivers/amlogic/media/vin/tvin/vdin/vdin_drv.c
drivers/amlogic/media/vin/tvin/vdin/vdin_drv.h
drivers/amlogic/media/vin/tvin/vdin/vdin_sm.c
drivers/amlogic/media/vin/tvin/vdin/vdin_vf.h
include/linux/amlogic/media/vfm/vframe.h
include/linux/amlogic/media/vfm/vframe_provider.h

index d22d90b..b135114 100644 (file)
@@ -919,6 +919,13 @@ bool hdmirx_check_frame_skip(struct tvin_frontend_s *fe)
        return hdmirx_hw_check_frame_skip();
 }
 
+bool hdmirx_dv_config(bool en, struct tvin_frontend_s *fe)
+{
+       set_dv_ll_mode(en);
+
+       return true;
+}
+
 static struct tvin_state_machine_ops_s hdmirx_sm_ops = {
        .nosig            = hdmirx_is_nosig,
        .fmt_changed      = hdmirx_fmt_chg,
@@ -930,6 +937,7 @@ static struct tvin_state_machine_ops_s hdmirx_sm_ops = {
        .vga_set_param    = NULL,
        .vga_get_param    = NULL,
        .check_frame_skip = hdmirx_check_frame_skip,
+       .hdmi_dv_config   = hdmirx_dv_config,
 };
 
 /*
index 8a7a570..0a9afd8 100644 (file)
@@ -46,7 +46,7 @@
  *
  *
  */
-#define RX_VER2 "ver.2019/05/18"
+#define RX_VER2 "ver.2019/07/18"
 
 /*print type*/
 #define        LOG_EN          0x01
index 0caf4d6..156c653 100644 (file)
@@ -2760,12 +2760,24 @@ void hdmirx_set_video_mute(bool mute)
                rx_pr("%s-mute:%d\n", __func__, mute);
 }
 
+void set_dv_ll_mode(bool en)
+{
+       if (en) {
+               hdmirx_wr_bits_top(TOP_VID_CNTL, _BIT(17), 1);
+               hdmirx_wr_bits_top(TOP_VID_CNTL, _BIT(19), 1);
+       } else {
+               hdmirx_wr_bits_top(TOP_VID_CNTL, _BIT(17), 0);
+               hdmirx_wr_bits_top(TOP_VID_CNTL, _BIT(19), 0);
+       }
+}
+
 /*
  * hdmirx_config_video - video mute config
  */
 void hdmirx_config_video(void)
 {
        hdmirx_set_video_mute(0);
+       set_dv_ll_mode(false);
 }
 
 /*
index 2b3ca23..ebc34d2 100644 (file)
@@ -1202,6 +1202,7 @@ extern void rx_get_video_info(void);
 extern void hdmirx_set_video_mute(bool mute);
 extern void hdmirx_config_video(void);
 extern void hdmirx_config_audio(void);
+extern void set_dv_ll_mode(bool en);
 extern void rx_get_audinfo(struct aud_info_s *audio_info);
 extern bool rx_clkrate_monitor(void);
 
index ddfbb68..1876ac7 100644 (file)
@@ -63,6 +63,7 @@ struct tvin_state_machine_ops_s {
                        struct tvin_frontend_s *fe);
        bool (*check_frame_skip)(struct tvin_frontend_s *fe);
        bool (*get_secam_phase)(struct tvin_frontend_s *fe);
+       bool (*hdmi_dv_config)(bool en, struct tvin_frontend_s *fe);
 };
 
 struct tvin_frontend_s {
index e6512aa..ef3e7b7 100644 (file)
@@ -23,6 +23,7 @@
 /* #include <mach/am_regs.h> */
 #include <linux/amlogic/iomap.h>
 #include <linux/amlogic/cpu_version.h>
+#include <linux/amlogic/media/vfm/vframe.h>
 
 #ifdef TVBUS_REG_ADDR
 #define R_APB_REG(reg) aml_read_reg32(TVBUS_REG_ADDR(reg))
@@ -482,6 +483,7 @@ struct tvin_sig_property_s {
        unsigned int            vdin_hdr_Flag;
        enum tvin_color_fmt_range_e color_fmt_range;
        struct tvin_hdr_info_s hdr_info;
+       struct tvin_dv_vsif_s dv_vsif;/*dolby vsi info*/
        bool dolby_vision;/*is signal dolby version*/
        bool low_latency;/*is low latency dolby mode*/
        uint8_t fps;
index 179bf49..b1d5b4b 100644 (file)
@@ -563,8 +563,15 @@ void vdin_get_format_convert(struct vdin_dev_s *devp)
        }
 #ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION
        if ((devp->dv.dolby_input & (1 << devp->index)) ||
-               (devp->dv.dv_flag && is_dolby_vision_enable()))
-               format_convert = VDIN_FORMAT_CONVERT_YUV_YUV444;
+               (devp->dv.dv_flag && is_dolby_vision_enable())) {
+               if (devp->dv.low_latency) {
+                       if (devp->prop.color_format == TVIN_YUV422)
+                               format_convert = VDIN_FORMAT_CONVERT_YUV_YUV444;
+                       else if (devp->prop.color_format == TVIN_RGB444)
+                               format_convert = VDIN_FORMAT_CONVERT_RGB_RGB;
+               } else
+                       format_convert = VDIN_FORMAT_CONVERT_YUV_YUV444;
+       }
 #endif
        devp->format_convert = format_convert;
 }
@@ -1019,6 +1026,9 @@ void vdin_set_cutwin(struct vdin_dev_s *devp)
                        devp->prop.hs, devp->prop.he,
                        devp->prop.vs, devp->prop.ve);
        }
+       if (vdin_ctl_dbg)
+               pr_info("h_active=%d, v_active=%d\n",
+                       devp->h_active, devp->v_active);
 
 }
 
@@ -1632,13 +1642,13 @@ void vdin_set_matrix(struct vdin_dev_s *devp)
                                devp->prop.color_fmt_range,
                                devp->prop.vdin_hdr_Flag,
                                devp->color_range_mode);
-#ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION
+               #ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION
                if ((devp->dv.dolby_input & (1 << devp->index)) ||
                (devp->dv.dv_flag && is_dolby_vision_enable()) ||
                devp->parm.info.fmt == TVIN_SIG_FMT_CVBS_SECAM)
                        wr_bits(offset, VDIN_MATRIX_CTRL, 0,
                                VDIN_MATRIX_EN_BIT, VDIN_MATRIX_EN_WID);
-#endif
+               #endif
                wr_bits(offset, VDIN_MATRIX_CTRL, 3,
                        VDIN_PROBE_SEL_BIT, VDIN_PROBE_SEL_WID);
        } else {
@@ -2620,6 +2630,34 @@ void vdin_set_all_regs(struct vdin_dev_s *devp)
                        devp->bt_path);
 }
 
+void vdin_set_dolby_ll_tunnel(struct vdin_dev_s *devp)
+{
+       unsigned int vdin_data_bus_0 = VDIN_MAP_BPB;
+       unsigned int vdin_data_bus_1 = VDIN_MAP_Y_G;
+       unsigned int vdin_data_bus_2 = VDIN_MAP_RCR;
+       unsigned int offset;
+       struct tvin_state_machine_ops_s *sm_ops;
+
+       /* avoid null pointer oops */
+       if (!devp || !(devp->frontend) || !(devp->frontend->sm_ops)
+               || !(devp->frontend->sm_ops->hdmi_dv_config))
+               return;
+
+       if ((devp->dv.dv_flag) && is_dolby_vision_enable()
+               && (devp->dv.low_latency)
+               && (devp->prop.color_format == TVIN_YUV422)) {
+               offset = devp->addr_offset;
+               wr_bits(offset, VDIN_COM_CTRL0, vdin_data_bus_0,
+                               COMP0_OUT_SWT_BIT, COMP0_OUT_SWT_WID);
+               wr_bits(offset, VDIN_COM_CTRL0, vdin_data_bus_1,
+                               COMP1_OUT_SWT_BIT, COMP1_OUT_SWT_WID);
+               wr_bits(offset, VDIN_COM_CTRL0, vdin_data_bus_2,
+                               COMP2_OUT_SWT_BIT, COMP2_OUT_SWT_WID);
+               sm_ops = devp->frontend->sm_ops;
+               sm_ops->hdmi_dv_config(true, devp->frontend);
+       }
+}
+
 static void vdin_delay_line(unsigned short num, unsigned int offset)
 {
        wr_bits(offset, VDIN_COM_CTRL0, num,
@@ -3120,6 +3158,7 @@ void vdin_enable_module(unsigned int offset, bool enable)
                /* else */
                /* aml_write_cbus(HHI_VDIN_MEAS_CLK_CNTL, 0x00000000); */
                vdin_hw_disable(offset);
+               vdin_dobly_mdata_write_en(offset, false);
        }
 }
 #if 0
@@ -3486,6 +3525,15 @@ void vdin_set_bitdepth(struct vdin_dev_s *devp)
                wr_bits(offset, VDIN_WR_CTRL2, 1,
                        VDIN_WR_10BIT_MODE_BIT, VDIN_WR_10BIT_MODE_WID);
                break;
+       /*
+        * vdin not support 12bit now, when rx submit is 12bit,
+        *      vdin config it as 10bit , 12 to 10
+        */
+       case COLOR_DEEPS_12BIT:
+               devp->source_bitdepth = 10;
+               wr_bits(offset, VDIN_WR_CTRL2, 1,
+                       VDIN_WR_10BIT_MODE_BIT, VDIN_WR_10BIT_MODE_WID);
+               break;
        case COLOR_DEEPS_AUTO:
                /* vdin_bit_depth is set to 0 by defaut, in this case,
                devp->source_bitdepth is controlled by colordepth
@@ -3970,6 +4018,9 @@ void vdin_dolby_config(struct vdin_dev_s *devp)
        unsigned int offset = devp->addr_offset;
 
        devp->dv.dv_config = 1;
+       devp->vfp->low_latency = devp->dv.low_latency;
+       memcpy(&devp->vfp->dv_vsif,
+               &devp->dv.dv_vsif, sizeof(struct tvin_dv_vsif_s));
        wr_bits(offset, VDIN_DOLBY_DSC_CTRL0, 1, 30, 1);
        wr_bits(offset, VDIN_DOLBY_DSC_CTRL0, 1, 26, 1);
        wr_bits(offset, VDIN_DOLBY_DSC_CTRL0, 0, 26, 1);
@@ -3982,12 +4033,32 @@ void vdin_dolby_config(struct vdin_dev_s *devp)
                wr_bits(offset, VDIN_DOLBY_AXI_CTRL0, 1, 5, 1);
                wr_bits(offset, VDIN_DOLBY_AXI_CTRL0, 0, 5, 1);
                wr_bits(offset, VDIN_DOLBY_AXI_CTRL0, 0, 4, 1);
+               /*enable wr memory*/
+               vdin_dobly_mdata_write_en(offset, 1);
        } else {
+               /*disable wr memory*/
+               vdin_dobly_mdata_write_en(offset, 0);
                wr(offset, VDIN_DOLBY_DSC_CTRL2, 0x5180c0d5);
                wr(offset, VDIN_DOLBY_DSC_CTRL3, 0x0);
        }
 }
 
+void vdin_dobly_mdata_write_en(unsigned int offset, unsigned int en)
+{
+       /*printk("=========>> wr memory %d\n", en);*/
+       if (en) {
+               /*enable write metadate to memory*/
+               wr_bits(offset, VDIN_DOLBY_AXI_CTRL0, 1, 30, 1);
+               /*vdin0 dolby meta write enable*/
+               /*W_VCBUS_BIT(0x27af, 1, 2, 1);*/
+       } else {
+               /*disable write metadate to memory*/
+               wr_bits(offset, VDIN_DOLBY_AXI_CTRL0, 0, 30, 1);
+               /*vdin0 dolby meta write disable*/
+               /*W_VCBUS_BIT(0x27af, 0, 2, 1);*/
+       }
+}
+
 unsigned int vdin0_afbce_debug_force;
 int vdin_event_cb(int type, void *data, void *op_arg)
 {
@@ -4020,7 +4091,10 @@ int vdin_event_cb(int type, void *data, void *op_arg)
                req->aux_size = 0;
                req->dv_enhance_exist = 0;
                /* TODO: need change the low latency flag when LL mode */
-               req->low_latency = 0;
+               req->low_latency = p->low_latency;
+               memcpy(&req->dv_vsif,
+                       &p->dv_vsif, sizeof(struct tvin_dv_vsif_s));
+
                if (req->bot_flag)
                        index = (req->vf->index >> 8) & 0xff;
                if (index != 0xff
@@ -4302,15 +4376,17 @@ u32 vdin_get_curr_field_type(struct vdin_dev_s *devp)
                if (devp->afbce_mode_pre)
                        type |= VIDTYPE_COMB_MODE;
        } else if ((format_convert == VDIN_FORMAT_CONVERT_YUV_YUV422) ||
-                       (format_convert == VDIN_FORMAT_CONVERT_RGB_YUV422))
+                       (format_convert == VDIN_FORMAT_CONVERT_RGB_YUV422)) {
                type |= VIDTYPE_VIU_422;
-       else if (devp->prop.dest_cfmt == TVIN_NV21) {
+       } else if ((format_convert == VDIN_FORMAT_CONVERT_YUV_RGB) ||
+               (format_convert == VDIN_FORMAT_CONVERT_RGB_RGB)) {
+               type |= VIDTYPE_RGB_444;
+       } else if (devp->prop.dest_cfmt == TVIN_NV21) {
                type |= VIDTYPE_VIU_NV21;
                type &= (~VIDTYPE_VIU_SINGLE_PLANE);
        } else if (devp->prop.dest_cfmt == TVIN_NV12) {
                /* type |= VIDTYPE_VIU_NV12; */
                type &= (~VIDTYPE_VIU_SINGLE_PLANE);
-
        }
 
        if (devp->afbce_valid)
@@ -4615,4 +4691,3 @@ void vdin_clk_onoff(struct vdin_dev_s *devp, bool onoff)
        }
 }
 
-
index 4393f7f..0d7abf6 100644 (file)
@@ -219,8 +219,9 @@ extern enum tvin_force_color_range_e color_range_force;
 
 extern void vdin_vlock_input_sel(unsigned int type,
        enum vframe_source_type_e source_type);
-
+extern void vdin_set_dolby_ll_tunnel(struct vdin_dev_s *devp);
 extern void vdin_check_hdmi_hdr(struct vdin_dev_s *devp);
+extern void vdin_dobly_mdata_write_en(unsigned int offset, unsigned int en);
 
 #endif
 
index c085962..62a148d 100644 (file)
@@ -812,25 +812,6 @@ static void vdin_dump_state(struct vdin_dev_s *devp)
        pr_info("vdin_drop_cnt: %d\n", vdin_drop_cnt);
        pr_info("game_mode cfg :  0x%x\n", game_mode);
        pr_info("game_mode cur:  0x%x\n", devp->game_mode);
-       pr_info("dolby_input :  %d\n", devp->dv.dolby_input);
-       if ((devp->cma_config_en != 1) || !(devp->cma_config_flag & 0x100))
-               pr_info("dolby_mem_start = %ld, dolby_mem_size = %d\n",
-                       (devp->mem_start +
-                       devp->mem_size - devp->canvas_max_num*dolby_size_byte),
-                       dolby_size_byte);
-       else
-               for (i = 0; i < devp->canvas_max_num; i++)
-                       pr_info("dolby_mem_start[%d] = %ld, dolby_mem_size = %d\n",
-                               i, (devp->vfmem_start[i] + devp->vfmem_size -
-                               dolby_size_byte), dolby_size_byte);
-       for (i = 0; i < devp->canvas_max_num; i++) {
-               pr_info("dv_mem(%d):0x%x\n",
-                       devp->vfp->dv_buf_size[i],
-                       devp->vfp->dv_buf_mem[i]);
-       }
-       pr_info("dv_flag:%d;dv_config:%d,dolby_vision:%d\n",
-               devp->dv.dv_flag, devp->dv.dv_config, devp->prop.dolby_vision);
-       pr_info("size of struct vdin_dev_s: %d\n", devp->vdin_dev_ssize);
 
        pr_info("afbce_flag: 0x%x\n", devp->afbce_flag);
        pr_info("afbce_mode: %d\n", devp->afbce_mode);
@@ -857,6 +838,57 @@ static void vdin_dump_state(struct vdin_dev_s *devp)
                                devp->afbce_info->frame_body_size);
                }
        }
+
+       pr_info("dolby_input :  %d\n", devp->dv.dolby_input);
+       if ((devp->cma_config_en != 1) || !(devp->cma_config_flag & 0x100))
+               pr_info("dolby_mem_start = %ld, dolby_mem_size = %d\n",
+                       (devp->mem_start +
+                       devp->mem_size - devp->canvas_max_num*dolby_size_byte),
+                       dolby_size_byte);
+       else
+               for (i = 0; i < devp->canvas_max_num; i++)
+                       pr_info("dolby_mem_start[%d] = %ld, dolby_mem_size = %d\n",
+                               i, (devp->vfmem_start[i] + devp->vfmem_size -
+                               dolby_size_byte), dolby_size_byte);
+       for (i = 0; i < devp->canvas_max_num; i++) {
+               pr_info("dv_mem(%d):0x%x\n",
+                       devp->vfp->dv_buf_size[i],
+                       devp->vfp->dv_buf_mem[i]);
+       }
+       pr_info("dvEn:%d,dv_flag:%d;dv_cfg:%d,dolby_ver:%d,low_latency:(%d,%d,%d)\n",
+               is_dolby_vision_enable(),
+               devp->dv.dv_flag, devp->dv.dv_config, devp->prop.dolby_vision,
+               devp->dv.low_latency, devp->prop.low_latency,
+               devp->vfp->low_latency);
+
+       pr_info("size of struct vdin_dev_s: %d\n", devp->vdin_dev_ssize);
+       pr_info("devp->dv.dv_vsif:(%d,%d,%d,%d,%d,%d,%d,%d);\n",
+               devp->dv.dv_vsif.dobly_vision_signal,
+               devp->dv.dv_vsif.backlt_ctrl_MD_present,
+               devp->dv.dv_vsif.auxiliary_MD_present,
+               devp->dv.dv_vsif.eff_tmax_PQ_hi,
+               devp->dv.dv_vsif.eff_tmax_PQ_low,
+               devp->dv.dv_vsif.auxiliary_runmode,
+               devp->dv.dv_vsif.auxiliary_runversion,
+               devp->dv.dv_vsif.auxiliary_debug0);
+       pr_info("devp->prop.dv_vsif:(%d,%d,%d,%d,%d,%d,%d,%d)\n",
+               devp->prop.dv_vsif.dobly_vision_signal,
+               devp->prop.dv_vsif.backlt_ctrl_MD_present,
+               devp->prop.dv_vsif.auxiliary_MD_present,
+               devp->prop.dv_vsif.eff_tmax_PQ_hi,
+               devp->prop.dv_vsif.eff_tmax_PQ_low,
+               devp->prop.dv_vsif.auxiliary_runmode,
+               devp->prop.dv_vsif.auxiliary_runversion,
+               devp->prop.dv_vsif.auxiliary_debug0);
+       pr_info("devp->vfp->dv_vsif:(%d,%d,%d,%d,%d,%d,%d,%d)\n",
+               devp->vfp->dv_vsif.dobly_vision_signal,
+               devp->vfp->dv_vsif.backlt_ctrl_MD_present,
+               devp->vfp->dv_vsif.auxiliary_MD_present,
+               devp->vfp->dv_vsif.eff_tmax_PQ_hi,
+               devp->vfp->dv_vsif.eff_tmax_PQ_low,
+               devp->vfp->dv_vsif.auxiliary_runmode,
+               devp->vfp->dv_vsif.auxiliary_runversion,
+               devp->vfp->dv_vsif.auxiliary_debug0);
        pr_info("Vdin driver version :  %s\n", VDIN_VER);
 }
 
index ac9d704..7be5b3b 100644 (file)
@@ -74,6 +74,8 @@
 #define VDIN_CLS_NAME          "vdin"
 #define PROVIDER_NAME          "vdin"
 
+#define VDIN_DV_NAME           "dv_vdin"
+
 #define VDIN_PUT_INTERVAL (HZ/100)   /* 10ms, #define HZ 100 */
 
 static dev_t vdin_devno;
@@ -654,6 +656,8 @@ void vdin_start_dec(struct vdin_dev_s *devp)
                vdin_dolby_config(devp);
                if (vdin_dbg_en)
                        pr_info("vdin start dec dv input config\n");
+       } else {
+               vdin_dobly_mdata_write_en(devp->addr_offset, 0);
        }
 #endif
        devp->abnormal_cnt = 0;
@@ -674,8 +678,8 @@ void vdin_start_dec(struct vdin_dev_s *devp)
 
        vdin_hw_enable(devp->addr_offset);
        vdin_set_all_regs(devp);
+       vdin_set_dolby_ll_tunnel(devp);
        vdin_write_mif_or_afbce_init(devp);
-
        if (!(devp->parm.flag & TVIN_PARM_FLAG_CAP) &&
                (devp->frontend) &&
                devp->frontend->dec_ops &&
@@ -701,7 +705,7 @@ void vdin_start_dec(struct vdin_dev_s *devp)
 #ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION
        if ((devp->dv.dolby_input & (1 << devp->index)) ||
                (devp->dv.dv_flag && is_dolby_vision_enable()))
-               vf_notify_receiver("dv_vdin",
+               vf_notify_receiver(VDIN_DV_NAME,
                        VFRAME_EVENT_PROVIDER_START, NULL);
        else
 #endif
@@ -1534,13 +1538,18 @@ irqreturn_t vdin_isr(int irq, void *dev_id)
                        schedule_delayed_work(&devp->dv.dv_dwork,
                                dv_work_delby);
                } else if (((dv_dbg_mask & DV_UPDATE_DATA_MODE_DELBY_WORK) == 0)
-                       && devp->dv.dv_config) {
+                       && devp->dv.dv_config && !devp->dv.low_latency) {
                        vdin_dolby_buffer_update(devp,
                                devp->last_wr_vfe->vf.index);
                        vdin_dolby_addr_update(devp,
                                devp->curr_wr_vfe->vf.index);
                } else
                        devp->dv.dv_crc_check = true;
+
+               if (devp->dv.low_latency != devp->vfp->low_latency)
+                       devp->vfp->low_latency = devp->dv.low_latency;
+               memcpy(&devp->vfp->dv_vsif,
+                       &devp->dv.dv_vsif, sizeof(struct tvin_dv_vsif_s));
                if ((devp->dv.dv_crc_check == true) ||
                        (!(dv_dbg_mask & DV_CRC_CHECK))) {
                        provider_vf_put(devp->last_wr_vfe, devp->vfp);
@@ -1570,7 +1579,7 @@ irqreturn_t vdin_isr(int irq, void *dev_id)
                if (((devp->dv.dolby_input & (1 << devp->index)) ||
                        (devp->dv.dv_flag && is_dolby_vision_enable())) &&
                        (devp->dv.dv_config == true))
-                       vf_notify_receiver("dv_vdin",
+                       vf_notify_receiver(VDIN_DV_NAME,
                                VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
                else {
 #endif
@@ -1786,7 +1795,7 @@ irqreturn_t vdin_isr(int irq, void *dev_id)
        if (((devp->dv.dolby_input & (1 << devp->index)) ||
                (devp->dv.dv_flag && is_dolby_vision_enable())) &&
                (devp->dv.dv_config == true))
-               vdin2nr = vf_notify_receiver("dv_vdin",
+               vdin2nr = vf_notify_receiver(VDIN_DV_NAME,
                        VFRAME_EVENT_PROVIDER_QUREY_VDIN2NR, NULL);
        else
 #endif
@@ -1925,7 +1934,7 @@ irqreturn_t vdin_isr(int irq, void *dev_id)
                if (((devp->dv.dolby_input & (1 << devp->index)) ||
                        (devp->dv.dv_flag && is_dolby_vision_enable()))
                        && (devp->dv.dv_config == true))
-                       vf_notify_receiver("dv_vdin",
+                       vf_notify_receiver(VDIN_DV_NAME,
                                VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
                else {
 #endif
@@ -3333,7 +3342,7 @@ static int vdin_drv_probe(struct platform_device *pdev)
        sprintf(vdevp->name, "%s%d", PROVIDER_NAME, vdevp->index);
        vf_provider_init(&vdevp->vprov, vdevp->name, &vdin_vf_ops, vdevp->vfp);
 
-       vf_provider_init(&vdevp->dv.vprov_dv, "dv_vdin",
+       vf_provider_init(&vdevp->dv.vprov_dv, VDIN_DV_NAME,
                &vdin_vf_ops, vdevp->vfp);
        /* @todo canvas_config_mode */
        if (canvas_config_mode == 0 || canvas_config_mode == 1)
index a39b473..e9070a9 100644 (file)
@@ -48,7 +48,7 @@
 /* Ref.2019/04/25: tl1 vdin0 afbce dynamically switch support,
  *                 vpp also should support this function
  */
-#define VDIN_VER "Ref.2019/05/31"
+#define VDIN_VER "Ref.2019/07/08-add dv ll mode"
 
 /*the counter of vdin*/
 #define VDIN_MAX_DEVS                  2
@@ -204,6 +204,8 @@ struct vdin_dv_s {
        bool dv_config;
        bool dv_crc_check;/*0:fail;1:ok*/
        unsigned int dv_mem_alloced;
+       struct tvin_dv_vsif_s dv_vsif;/*dolby vsi info*/
+       bool low_latency;
 };
 
 struct vdin_afbce_s {
index 3246fdc..64cf78b 100644 (file)
@@ -287,6 +287,11 @@ static void hdmirx_dv_check(struct vdin_dev_s *devp,
                tvin_smr_init(devp->index);
                devp->dv.dv_flag = prop->dolby_vision;
        }
+
+       if (prop->low_latency != devp->dv.low_latency)
+               devp->dv.low_latency = prop->low_latency;
+       memcpy(&devp->dv.dv_vsif,
+                       &prop->dv_vsif, sizeof(struct tvin_dv_vsif_s));
 }
 
 void reset_tvin_smr(unsigned int index)
index 02b3756..f45fd94 100644 (file)
@@ -128,6 +128,7 @@ struct vf_pool {
        spinlock_t fz_lock;
        unsigned int tmp_list_size;
        struct list_head tmp_list;
+       struct tvin_dv_vsif_s dv_vsif;/*dolby vsi info*/
        spinlock_t tmp_lock;
        spinlock_t log_lock;
        spinlock_t dv_lock;/*dolby vision lock*/
@@ -138,6 +139,7 @@ struct vf_pool {
        struct isr_log_s isr_log;
 #endif
        atomic_t buffer_cnt;
+       unsigned int low_latency;
        unsigned int dv_buf_mem[VDIN_DV_MAX_NUM];
        void *dv_buf_vmem[VDIN_DV_MAX_NUM];
        unsigned int dv_buf_size[VDIN_DV_MAX_NUM];
index c174708..19e4d82 100644 (file)
@@ -50,6 +50,7 @@
 #define VIDTYPE_NO_DW                  0x4000000
 #define VIDTYPE_SUPPORT_COMPRESS       0x8000000
 #define VIDTYPE_PRE_DI_AFBC            0x10000000
+#define VIDTYPE_RGB_444                        0x20000000
 
 #define DISP_RATIO_FORCECONFIG          0x80000000
 #define DISP_RATIO_FORCE_NORMALWIDE     0x40000000
@@ -232,6 +233,18 @@ struct vframe_pic_mode_s {
        enum pic_mode_provider_e provider;
 };
 
+/*vdin dolby vsi info param*/
+struct tvin_dv_vsif_s {
+       uint8_t dobly_vision_signal:1;
+       uint8_t backlt_ctrl_MD_present:1;
+       uint8_t auxiliary_MD_present:1;
+       uint8_t eff_tmax_PQ_hi;
+       uint8_t eff_tmax_PQ_low;
+       uint8_t auxiliary_runmode;
+       uint8_t auxiliary_runversion;
+       uint8_t auxiliary_debug0;
+};
+
 #define BITDEPTH_Y_SHIFT 8
 #define BITDEPTH_Y8    (0 << BITDEPTH_Y_SHIFT)
 #define BITDEPTH_Y9    (1 << BITDEPTH_Y_SHIFT)
index f67776e..cd6c9f6 100644 (file)
@@ -52,6 +52,7 @@ struct provider_aux_req_s {
        int aux_size;
        int dv_enhance_exist;
        int low_latency;
+       struct tvin_dv_vsif_s dv_vsif;/*dolby vsi info*/
 };
 struct provider_disp_mode_req_s {
        /*input*/