static void mdp4_dsi_cmd_overlay_nolock( struct msm_fb_data_type *mfd ) { int cndx = 0; struct vsycn_ctrl *vctrl; struct mdp4_overlay_pipe *pipe; vctrl = &vsync_ctrl_db[cndx]; pipe = vctrl->base_pipe; if (pipe == NULL) { pr_err("%s: NO base pipe\n", __func__); return; } mdp_clk_ctrl(1); if (pipe->mixer_stage == MDP4_MIXER_STAGE_BASE) { mdp4_mipi_vsync_enable(mfd, pipe, 0); mdp4_overlay_setup_pipe_addr(mfd, pipe); mdp4_dsi_cmd_pipe_queue(0, pipe); } mdp4_overlay_mdp_perf_upd(mfd, 1); mdp4_dsi_cmd_pipe_commit(cndx, 0); mdp4_dsi_cmd_busy(); mdp4_overlay_mdp_perf_upd(mfd, 0); mdp_clk_ctrl(0); }
void disp_ext_refresh_seq( struct msm_fb_data_type *mfd, unsigned int cmd ) { struct msm_fb_data_type *mipi_novatek_wxga_mfd; DISP_LOCAL_LOG_EMERG("DISP disp_ext_refresh_seq S\n"); #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM mipi_novatek_wxga_mfd = mipi_novatek_wxga_get_mfd(); #else mipi_novatek_wxga_mfd = mipi_renesas_cm_get_mfd(); #endif if( mipi_novatek_wxga_mfd == NULL ) { pr_debug("%s:bot found device\n", __func__); return; } if( disp_ext_reflesh_get_start() != 1 ) { DISP_LOCAL_LOG_EMERG("%s:refresh not start\n", __func__); return; } #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM mdp4_dsi_cmd_dma_busy_wait(mipi_novatek_wxga_mfd); mdp4_dsi_blt_dmap_busy_wait(mipi_novatek_wxga_mfd); mipi_dsi_mdp_busy_wait(mipi_novatek_wxga_mfd); #else mdp4_dsi_cmd_busy(); mipi_dsi_mdp_busy_wait(); #endif if( cmd == MIPI_REFREH_SEQ_ALL ) { mdp4_dsi_clock_mod(); disp_ext_refresh_te_monitor_timer_release(); disp_ext_reflesh_set_start(0); #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM mipi_set_tx_power_mode(1); mipi_novatek_wxga_initial_sequence( mipi_novatek_wxga_mfd ); mipi_set_tx_power_mode(0); mipi_novatek_wxga_display_direction_sequence( mipi_novatek_wxga_mfd ); mdp4_dsi_refresh_screen_at_once( mfd ); mipi_novatek_wxga_display_on_sequence( mipi_novatek_wxga_mfd ); #else mipi_renesas_cm_refresh_exec( mipi_novatek_wxga_mfd ); #endif disp_ext_reflesh_set_sw(0); disp_ext_reflesh_set_start(1); disp_ext_reflesh_before_te_run_count_init(); disp_ext_refresh_te_monitor_timer_set(); } DISP_LOCAL_LOG_EMERG("DISP disp_ext_refresh_seq E\n"); }
void mdp4_dsi_refresh_screen_at_once( struct msm_fb_data_type *mfd ) { int cndx = 0; struct vsycn_ctrl *vctrl; struct mdp4_overlay_pipe *pipe; DISP_LOCAL_LOG_EMERG("DISP %s S\n",__func__); if( mfd == NULL ){ return; } vctrl = &vsync_ctrl_db[cndx]; pipe = vctrl->base_pipe; if (pipe == NULL) { pr_err("%s: NO base pipe\n", __func__); return; } mdp_clk_ctrl(1); if (pipe->mixer_stage == MDP4_MIXER_STAGE_BASE) { mdp4_mipi_vsync_enable(mfd, pipe, 0); mdp4_overlay_setup_pipe_addr(mfd, pipe); mdp4_dsi_cmd_pipe_queue(0, pipe); } mdp4_overlay_mdp_perf_upd(mfd, 1); mdp4_dsi_screen_at_once_flag = 1; mdp4_dsi_cmd_pipe_commit(cndx, 0); mdp4_dsi_screen_at_once_flag = 0; mdp4_dsi_cmd_busy(); mdp4_overlay_mdp_perf_upd(mfd, 0); mdp_clk_ctrl(0); DISP_LOCAL_LOG_EMERG("DISP %s E\n",__func__); return; }
void disp_ext_refresh_err_report_check(struct msm_fb_data_type *mfd) { struct dsi_cmd_desc dm_dsi_cmds; #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM char mipi_reg; #else char mipi_reg[2]; #endif int ret; if(err_report_chek_count < 1) { err_report_chek_count++; return; } mdp_pipe_ctrl(MDP_CMD_BLOCK,MDP_BLOCK_POWER_ON, FALSE); #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM memset(&dm_dsi_cmds, 0x00, sizeof(dm_dsi_cmds)); mipi_reg = 0xAB; dm_dsi_cmds.dtype = DTYPE_DCS_READ; /* Command type */ dm_dsi_cmds.last = 1; /* Last command */ dm_dsi_cmds.vc = 0; /* Virtual Channel */ dm_dsi_cmds.ack = 1; /* Don't care, dsi_host default ON set */ dm_dsi_cmds.wait = 0; /* wait response by msleep() */ dm_dsi_cmds.dlen = 1; /* Data length */ dm_dsi_cmds.payload = &mipi_reg; /* Data */ if (mdp_rev >= MDP_REV_41) { mutex_lock(&mfd->dma->ov_mutex); } else { down(&mfd->dma->mutex); } mdp4_dsi_cmd_dma_busy_wait(mfd); mdp4_dsi_blt_dmap_busy_wait(mfd); mipi_dsi_mdp_busy_wait(); mdp4_dsi_clock_mod(); mipi_dsi_op_mode_config(DSI_CMD_MODE); /* LowSpeed */ mipi_set_tx_power_mode(1); ret = mipi_dsi_cmds_rx(mfd, &refresh_dsi_buff_tp, &refresh_dsi_buff_rp, &dm_dsi_cmds, 2); /* HighSpeed */ mipi_set_tx_power_mode(0); mipi_dsi_op_mode_config(mfd->panel_info.mipi.mode); if (mdp_rev >= MDP_REV_41) { mutex_unlock(&mfd->dma->ov_mutex); } else { up(&mfd->dma->mutex); } #else mipi_dsi_clk_cfg(1); memset(&dm_dsi_cmds, 0x00, sizeof(dm_dsi_cmds)); mipi_reg[0] = 0xB0; mipi_reg[1] = 0x04; dm_dsi_cmds.dtype = DTYPE_GEN_WRITE2; /* Command type */ dm_dsi_cmds.last = 1; /* Last command */ dm_dsi_cmds.vc = 0; /* Virtual Channel */ dm_dsi_cmds.ack = 1; /* Don't care, dsi_host default ON set */ dm_dsi_cmds.wait = 0; /* wait response by msleep() */ dm_dsi_cmds.dlen = 2; /* Data length */ dm_dsi_cmds.payload = mipi_reg; /* Data */ if (mdp_rev >= MDP_REV_41) { mutex_lock(&mfd->dma->ov_mutex); } else { down(&mfd->dma->mutex); } mdp4_dsi_cmd_busy(); mipi_dsi_mdp_busy_wait(); mdp4_dsi_clock_mod(); mipi_dsi_op_mode_config(DSI_CMD_MODE); mipi_set_tx_power_mode(0); mipi_dsi_cmds_tx(&refresh_dsi_buff_tp, &dm_dsi_cmds, 1); memset(&dm_dsi_cmds, 0x00, sizeof(dm_dsi_cmds)); mipi_reg[0] = 0xB5; dm_dsi_cmds.dtype = DTYPE_GEN_READ1; /* Command type */ dm_dsi_cmds.last = 1; /* Last command */ dm_dsi_cmds.vc = 0; /* Virtual Channel */ dm_dsi_cmds.ack = 1; /* Don't care, dsi_host default ON set */ dm_dsi_cmds.wait = 0; /* wait response by msleep() */ dm_dsi_cmds.dlen = 1; /* Data length */ dm_dsi_cmds.payload = mipi_reg; /* Data */ mdp4_dsi_clock_mod(); mipi_dsi_op_mode_config(DSI_CMD_MODE); mipi_set_tx_power_mode(0); ret = mipi_dsi_cmds_rx( mfd, &refresh_dsi_buff_tp, &refresh_dsi_buff_rp, &dm_dsi_cmds, 3); if( ret == 0 || refresh_dsi_buff_rp.data[0] != 0 || refresh_dsi_buff_rp.data[1] != 0 || refresh_dsi_buff_rp.data[2] != 0 ) { disp_ext_reflesh_set_sw(1); } memset(&dm_dsi_cmds, 0x00, sizeof(dm_dsi_cmds)); mipi_reg[0] = 0x0A; dm_dsi_cmds.dtype = DTYPE_DCS_READ; /* Command type */ dm_dsi_cmds.last = 1; /* Last command */ dm_dsi_cmds.vc = 0; /* Virtual Channel */ dm_dsi_cmds.ack = 1; /* Don't care, dsi_host default ON set */ dm_dsi_cmds.wait = 0; /* wait response by msleep() */ dm_dsi_cmds.dlen = 1; /* Data length */ dm_dsi_cmds.payload = mipi_reg; /* Data */ mdp4_dsi_clock_mod(); mipi_dsi_op_mode_config(DSI_CMD_MODE); mipi_set_tx_power_mode(1); ret = mipi_dsi_cmds_rx( mfd, &refresh_dsi_buff_tp, &refresh_dsi_buff_rp, &dm_dsi_cmds, 1); if( ret == 0 || refresh_dsi_buff_rp.data[0] != 0x1c ) { disp_ext_reflesh_set_sw(1); } memset(&dm_dsi_cmds, 0x00, sizeof(dm_dsi_cmds)); mipi_reg[0] = 0xB0; mipi_reg[1] = 0x03; dm_dsi_cmds.dtype = DTYPE_GEN_WRITE2; /* Command type */ dm_dsi_cmds.last = 1; /* Last command */ dm_dsi_cmds.vc = 0; /* Virtual Channel */ dm_dsi_cmds.ack = 1; /* Don't care, dsi_host default ON set */ dm_dsi_cmds.wait = 0; /* wait response by msleep() */ dm_dsi_cmds.dlen = 2; /* Data length */ dm_dsi_cmds.payload = mipi_reg; /* Data */ mdp4_dsi_clock_mod(); mipi_dsi_op_mode_config(DSI_CMD_MODE); mipi_set_tx_power_mode(1); mipi_dsi_cmds_tx(&refresh_dsi_buff_tp, &dm_dsi_cmds, 1); mipi_dsi_op_mode_config(mfd->panel_info.mipi.mode); if (mdp_rev >= MDP_REV_41) { mutex_unlock(&mfd->dma->ov_mutex); } else { up(&mfd->dma->mutex); } mipi_dsi_clk_cfg(0); #endif mdp_pipe_ctrl(MDP_CMD_BLOCK,MDP_BLOCK_POWER_OFF, FALSE); #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM if( ret == 0 || refresh_dsi_buff_rp.data[0] != 0 || refresh_dsi_buff_rp.data[1] != 0 ) { disp_ext_reflesh_set_sw(1); } #endif }
int disp_ext_blc_mode_select( uint8_t mode ) { struct msm_fb_data_type *mfd; DISP_LOCAL_LOG_EMERG("DISP mipi_novatek_wxga_cabc_mode_select mode=%d S\n",mode); #ifdef CONFIG_DISP_EXT_UTIL disp_ext_util_mipitx_lock(); disp_ext_util_disp_local_lock(); #endif /* CONFIG_DISP_EXT_UTIL */ if( disp_ext_util_get_disp_state() != LOCAL_DISPLAY_ON ) { #ifdef CONFIG_DISP_EXT_UTIL disp_ext_util_disp_local_unlock(); disp_ext_util_mipitx_unlock(); #endif /* CONFIG_DISP_EXT_UTIL */ pr_err("%s:panel off\n", __func__); return -1; } if( mode > 0x01 ) { #ifdef CONFIG_DISP_EXT_UTIL disp_ext_util_disp_local_unlock(); disp_ext_util_mipitx_unlock(); #endif /* CONFIG_DISP_EXT_UTIL */ pr_err("%s:parameter err\n", __func__); return -1; } if( select_mode_ctrl == mode ) { #ifdef CONFIG_DISP_EXT_UTIL disp_ext_util_disp_local_unlock(); disp_ext_util_mipitx_unlock(); #endif /* CONFIG_DISP_EXT_UTIL */ DISP_LOCAL_LOG_EMERG("%s:Request a double. state=%d,req=%d\n",__func__,select_mode_ctrl,mode); return 0; } #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM mfd = mipi_novatek_wxga_get_mfd(); #else mfd = mipi_renesas_cm_get_mfd(); #endif if( mfd == NULL ) { #ifdef CONFIG_DISP_EXT_UTIL disp_ext_util_disp_local_unlock(); disp_ext_util_mipitx_unlock(); #endif /* CONFIG_DISP_EXT_UTIL */ pr_err("%s:mfd == NULL\n", __func__); return -1; } select_mode_ctrl=mode; msm_fb_pan_lock(); msm_fb_ioctl_ppp_lock(); msm_fb_ioctl_lut_lock(); #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM mdp4_dsi_cmd_dma_busy_wait(mfd); mdp4_dsi_blt_dmap_busy_wait(mfd); mipi_dsi_mdp_busy_wait(mfd); #else mdp4_dsi_cmd_busy(); mipi_dsi_mdp_busy_wait(); #endif if( mode == 0 ) { #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM cabc_change[1] = 0; #else cabc_mode_select_cmds = renesas_cm_blc_off_cmds; cabc_mode_select_cmds_size = ARRAY_SIZE(renesas_cm_blc_off_cmds); #endif } else { #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM cabc_change[1] = select_mode; #else cabc_mode_select_cmds = renesas_cm_blc_on_cmds; cabc_mode_select_cmds_size = ARRAY_SIZE(renesas_cm_blc_on_cmds); #endif } #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM pr_debug("%s:cabc_change[%d,%d]\n", __func__,cabc_change[0],cabc_change[1]); DISP_LOCAL_LOG_EMERG("%s:cabc_change[%d,%d]\n", __func__,cabc_change[0],cabc_change[1]); #endif #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM mipi_dsi_cmds_tx(mfd, &disp_ext_blc_tx_buf, cabc_mode_select_cmds, ARRAY_SIZE(cabc_mode_select_cmds)); #else mipi_set_tx_power_mode(0); mipi_dsi_clk_cfg(1); mipi_dsi_cmds_tx(&disp_ext_blc_tx_buf, cabc_mode_select_cmds, cabc_mode_select_cmds_size); mipi_dsi_clk_cfg(0); #endif udelay(1); msm_fb_ioctl_lut_unlock(); msm_fb_ioctl_ppp_unlock(); msm_fb_pan_unlock(); #ifdef CONFIG_DISP_EXT_UTIL disp_ext_util_disp_local_unlock(); disp_ext_util_mipitx_unlock(); #endif /* CONFIG_DISP_EXT_UTIL */ pr_debug("%s:cabc select\n", __func__); DISP_LOCAL_LOG_EMERG("DISP mipi_novatek_wxga_cabc_mode_select E\n"); return 0; }