Exemple #1
0
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;
}
Exemple #2
0
int disp_ext_blc_mode_select( uint8_t mode )
{
#ifdef DISP_BLC_CTRL_ENABLE
	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;
	}

	mfd = mipi_novatek_wxga_get_mfd();
	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();
	mipi_dsi_mdp_busy_wait();
	if( mode == 0 ) {
		cabc_change[1] = 0;
	}
	else {
		cabc_change[1] = select_mode;
	}
	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]);
	mipi_dsi_clk_cfg(1);
	mipi_dsi_cmds_tx( &disp_ext_blc_tx_buf,
					cabc_mode_select_cmds,
					ARRAY_SIZE(cabc_mode_select_cmds));
	mipi_dsi_clk_cfg(0);
	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");
#endif /*DISP_BLC_CTRL_ENABLE*/
	return 0;
}