|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区
您需要 登录 才可以下载或查看,没有账号?立即注册
×
!= info && extend_win->state &&
hdmi_switch_complete) {
@@ -1488,6 +1500,7 @@ static int rk_fb_pan_display(struct fb_var_screeninfo *var,
extend_dev_drv->ops->cfg_done(extend_dev_drv);
}
}
+#endif
#ifdef CONFIG_FB_MIRRORING
if (video_data_to_mirroring)
video_data_to_mirroring(info, NULL);
@@ -1501,7 +1514,7 @@ static int rk_fb_get_list_stat(struct rk_lcdc_driver *dev_drv)
int i, j;
i = list_empty(&dev_drv->update_regs_list);
- j = list_empty(&saved_list);
+ j = list_empty(&dev_drv->saved_list);
return i == j ? 0 : 1;
}
@@ -1601,7 +1614,9 @@ void rk_fb_free_dma_buf(struct rk_lcdc_driver *dev_drv,
struct rk_fb_reg_area_data *area_data;
struct rk_fb *rk_fb = platform_get_drvdata(fb_pdev);
#if defined(CONFIG_ROCKCHIP_IOMMU)
+ #ifdef HDMI_SET_BY_FB
struct rk_lcdc_driver *ext_dev_drv = rk_get_extend_lcdc_drv();
+ #endif
#endif
for (i = 0; i < reg_win_data->area_num; i++) {
@@ -1614,6 +1629,7 @@ void rk_fb_free_dma_buf(struct rk_lcdc_driver *dev_drv,
area_data->ion_handle);
freed_addr[freed_index++] = area_data->smem_start;
}
+#ifdef HDMI_SET_BY_FB
if (rk_fb->disp_mode == DUAL && hdmi_switch_complete) {
if (ext_dev_drv->iommu_enabled)
ion_unmap_iommu(ext_dev_drv->dev,
@@ -1621,6 +1637,7 @@ void rk_fb_free_dma_buf(struct rk_lcdc_driver *dev_drv,
area_data->ion_handle);
}
#endif
+#endif
if (area_data->ion_handle != NULL) {
ion_unmap_kernel(rk_fb->ion_client,
area_data->ion_handle);
@@ -1632,6 +1649,7 @@ void rk_fb_free_dma_buf(struct rk_lcdc_driver *dev_drv,
memset(reg_win_data, 0, sizeof(struct rk_fb_reg_win_data));
}
+#ifdef HDMI_SET_BY_FB
/*
* function: update extend win info acorrding to primary win info,
the function is only used for dual display mode
@@ -1771,6 +1789,7 @@ static int rk_fb_update_ext_win(struct rk_lcdc_driver *ext_dev_drv,
return 0;
}
+#endif
static void rk_fb_update_win(struct rk_lcdc_driver *dev_drv,
struct rk_lcdc_win *win,
@@ -1908,8 +1927,10 @@ static void rk_fb_update_reg(struct rk_lcdc_driver *dev_drv,
struct rk_lcdc_win *win;
ktime_t timestamp = dev_drv->vsync_info.timestamp;
struct rk_fb *rk_fb = platform_get_drvdata(fb_pdev);
+#ifdef HDMI_SET_BY_FB
struct rk_lcdc_driver *ext_dev_drv;
struct rk_lcdc_win *ext_win;
+#endif
struct rk_fb_reg_win_data *win_data;
bool wait_for_vsync;
int count = 100;
@@ -1932,12 +1953,15 @@ static void rk_fb_update_reg(struct rk_lcdc_driver *dev_drv,
win_data = rk_fb_get_win_data(regs, i);
if (win_data) {
if (rk_fb->disp_policy == DISPLAY_POLICY_BOX &&
- win_data->data_format == YUV420)
+ (win_data->data_format == YUV420 ||
+ win_data->data_format == YUV420_A))
continue;
+ mutex_lock(&dev_drv->win_config);
rk_fb_update_win(dev_drv, win, win_data);
win->state = 1;
dev_drv->ops->set_par(dev_drv, i);
dev_drv->ops->pan_display(dev_drv, i);
+ mutex_unlock(&dev_drv->win_config);
#if defined(CONFIG_ROCKCHIP_IOMMU)
if (dev_drv->iommu_enabled) {
g_last_addr = win_data->reg_area_data[0].smem_start +
@@ -1952,6 +1976,8 @@ static void rk_fb_update_reg(struct rk_lcdc_driver *dev_drv,
dev_drv->ops->ovl_mgr(dev_drv, 0, 1);
if (rk_fb->disp_policy == DISPLAY_POLICY_BOX)
dev_drv->ops->cfg_done(dev_drv);
+
+#ifdef HDMI_SET_BY_FB
if ((rk_fb->disp_mode == DUAL)
&& (hdmi_get_hotplug() == HDMI_HPD_ACTIVED)
&& hdmi_switch_complete) {
@@ -1990,6 +2016,8 @@ static void rk_fb_update_reg(struct rk_lcdc_driver *dev_drv,
ext_dev_drv->ops->cfg_done(ext_dev_drv);
}
ext_win_exit:
+#endif
+
dev_drv->ops->cfg_done(dev_drv);
do {
@@ -1997,12 +2025,28 @@ ext_win_exit:
timeout = wait_event_interruptible_timeout(dev_drv->vsync_info.wait,
ktime_compare(dev_drv->vsync_info.timestamp, timestamp) > 0,
msecs_to_jiffies(25));
+ #ifdef HDMI_SET_BY_FB
+ if ((rk_fb->disp_mode == DUAL) &&
+ (hdmi_get_hotplug() == HDMI_HPD_ACTIVED) &&
+ hdmi_switch_complete) {
+ /*
+ * If dual output, we need make sure the extend display
+ * cfg take effect before release fence.
+ */
+ ext_dev_drv = rk_get_extend_lcdc_drv();
+ timeout = wait_event_interruptible_timeout(ext_dev_drv->vsync_info.wait,
+ ktime_compare(ext_dev_drv->vsync_info.timestamp, timestamp) > 0,
+ msecs_to_jiffies(25));
+ }
+ #endif
+
dev_drv->ops->get_dsp_addr(dev_drv, dsp_addr);
wait_for_vsync = false;
for (i = 0; i < dev_drv->lcdc_win_num; i++) {
if (dev_drv->win->state == 1) {
if (rk_fb->disp_policy == DISPLAY_POLICY_BOX &&
(dev_drv->win->format == YUV420 ||
+ dev_drv->win->format == YUV420_A ||
!strcmp(dev_drv->win->name, "hwc"))) {
continue;
} else {
@@ -2037,19 +2081,50 @@ ext_win_exit:
g_last_timeout = timeout;
}
#endif
- for (i = 0; i < g_last_win_num; i++)
- rk_fb_free_dma_buf(dev_drv, &g_reg_win_data);
+ if(dev_drv->id==0)
+ {
+ for (i = 0; i < lcdc0_g_last_win_num; i++)
+ {
+ rk_fb_free_dma_buf(dev_drv, &lcdc0_g_reg_win_data);
+ //printk("----lcdc0 %s rk_fb_free_dma_buf i=%d,g_last_win_num=%d\n",__FUNCTION__,i,lcdc0_g_last_win_num);
+
+ }
+ }
+ else//(dev_drv->id==1)
+ {
+ for (i = 0; i < lcdc1_g_last_win_num; i++)
+ {
+ |
|