aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-11-09 08:30:11 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-12-02 01:54:42 -0500
commit9a147a65de1ac89e506ef90413f41ebd96e03fd3 (patch)
treed13411fe928f156beb88a5c0d4408c3f6b68c07e
parente0a2aa5b3d1a26969ba906447c816d44c018969d (diff)
OMAPDSS: DSI: call mgr_enable/disable for cmd mode displays
The current code uses dsi_video_mode_enable/disable functions to enable/disable DISPC output for video mode displays. For command mode displays we have no notion in the DISPC side of whether the panel is enabled, except when a dss_mgr_start_update() call is made. However, to properly maintain the DISPC state in apply.c, we need to know if a manager used for a manual update display is currently in use. This patch achieves that by changing dsi_video_mode_enable/disable to dsi_enable/disable_video_output, which is called by both video and command mode displays. For video mode displays it starts the actual pixel stream, as it did before. For command mode displays it doesn't do anything else than mark that the manager is currently in use. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/displays/panel-taal.c6
-rw-r--r--drivers/video/omap2/dss/apply.c6
-rw-r--r--drivers/video/omap2/dss/dsi.c73
-rw-r--r--include/video/omapdss.h4
4 files changed, 51 insertions, 38 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index dd64bd13f4f8..00c5c615585f 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -1182,6 +1182,10 @@ static int taal_power_on(struct omap_dss_device *dssdev)
1182 if (r) 1182 if (r)
1183 goto err; 1183 goto err;
1184 1184
1185 r = dsi_enable_video_output(dssdev, td->channel);
1186 if (r)
1187 goto err;
1188
1185 td->enabled = 1; 1189 td->enabled = 1;
1186 1190
1187 if (!td->intro_printed) { 1191 if (!td->intro_printed) {
@@ -1211,6 +1215,8 @@ static void taal_power_off(struct omap_dss_device *dssdev)
1211 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 1215 struct taal_data *td = dev_get_drvdata(&dssdev->dev);
1212 int r; 1216 int r;
1213 1217
1218 dsi_disable_video_output(dssdev, td->channel);
1219
1214 r = taal_dcs_write_0(td, MIPI_DCS_SET_DISPLAY_OFF); 1220 r = taal_dcs_write_0(td, MIPI_DCS_SET_DISPLAY_OFF);
1215 if (!r) 1221 if (!r)
1216 r = taal_sleep_in(td); 1222 r = taal_sleep_in(td);
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index eafa80846365..936571b7aace 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -648,7 +648,8 @@ void dss_mgr_enable(struct omap_overlay_manager *mgr)
648{ 648{
649 mutex_lock(&apply_lock); 649 mutex_lock(&apply_lock);
650 650
651 dispc_mgr_enable(mgr->id, true); 651 if (!mgr_manual_update(mgr))
652 dispc_mgr_enable(mgr->id, true);
652 mgr->enabled = true; 653 mgr->enabled = true;
653 654
654 mutex_unlock(&apply_lock); 655 mutex_unlock(&apply_lock);
@@ -658,7 +659,8 @@ void dss_mgr_disable(struct omap_overlay_manager *mgr)
658{ 659{
659 mutex_lock(&apply_lock); 660 mutex_lock(&apply_lock);
660 661
661 dispc_mgr_enable(mgr->id, false); 662 if (!mgr_manual_update(mgr))
663 dispc_mgr_enable(mgr->id, false);
662 mgr->enabled = false; 664 mgr->enabled = false;
663 665
664 mutex_unlock(&apply_lock); 666 mutex_unlock(&apply_lock);
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 9358afa2a77e..9cb2e827c001 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -3973,65 +3973,70 @@ static void dsi_proto_timings(struct omap_dss_device *dssdev)
3973 } 3973 }
3974} 3974}
3975 3975
3976int dsi_video_mode_enable(struct omap_dss_device *dssdev, int channel) 3976int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel)
3977{ 3977{
3978 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 3978 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
3979 int bpp = dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt); 3979 int bpp = dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt);
3980 u8 data_type; 3980 u8 data_type;
3981 u16 word_count; 3981 u16 word_count;
3982 3982
3983 switch (dssdev->panel.dsi_pix_fmt) { 3983 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) {
3984 case OMAP_DSS_DSI_FMT_RGB888: 3984 switch (dssdev->panel.dsi_pix_fmt) {
3985 data_type = MIPI_DSI_PACKED_PIXEL_STREAM_24; 3985 case OMAP_DSS_DSI_FMT_RGB888:
3986 break; 3986 data_type = MIPI_DSI_PACKED_PIXEL_STREAM_24;
3987 case OMAP_DSS_DSI_FMT_RGB666: 3987 break;
3988 data_type = MIPI_DSI_PIXEL_STREAM_3BYTE_18; 3988 case OMAP_DSS_DSI_FMT_RGB666:
3989 break; 3989 data_type = MIPI_DSI_PIXEL_STREAM_3BYTE_18;
3990 case OMAP_DSS_DSI_FMT_RGB666_PACKED: 3990 break;
3991 data_type = MIPI_DSI_PACKED_PIXEL_STREAM_18; 3991 case OMAP_DSS_DSI_FMT_RGB666_PACKED:
3992 break; 3992 data_type = MIPI_DSI_PACKED_PIXEL_STREAM_18;
3993 case OMAP_DSS_DSI_FMT_RGB565: 3993 break;
3994 data_type = MIPI_DSI_PACKED_PIXEL_STREAM_16; 3994 case OMAP_DSS_DSI_FMT_RGB565:
3995 break; 3995 data_type = MIPI_DSI_PACKED_PIXEL_STREAM_16;
3996 default: 3996 break;
3997 BUG(); 3997 default:
3998 }; 3998 BUG();
3999 };
3999 4000
4000 dsi_if_enable(dsidev, false); 4001 dsi_if_enable(dsidev, false);
4001 dsi_vc_enable(dsidev, channel, false); 4002 dsi_vc_enable(dsidev, channel, false);
4002 4003
4003 /* MODE, 1 = video mode */ 4004 /* MODE, 1 = video mode */
4004 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 1, 4, 4); 4005 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 1, 4, 4);
4005 4006
4006 word_count = DIV_ROUND_UP(dssdev->panel.timings.x_res * bpp, 8); 4007 word_count = DIV_ROUND_UP(dssdev->panel.timings.x_res * bpp, 8);
4007 4008
4008 dsi_vc_write_long_header(dsidev, channel, data_type, word_count, 0); 4009 dsi_vc_write_long_header(dsidev, channel, data_type,
4010 word_count, 0);
4009 4011
4010 dsi_vc_enable(dsidev, channel, true); 4012 dsi_vc_enable(dsidev, channel, true);
4011 dsi_if_enable(dsidev, true); 4013 dsi_if_enable(dsidev, true);
4014 }
4012 4015
4013 dss_mgr_enable(dssdev->manager); 4016 dss_mgr_enable(dssdev->manager);
4014 4017
4015 return 0; 4018 return 0;
4016} 4019}
4017EXPORT_SYMBOL(dsi_video_mode_enable); 4020EXPORT_SYMBOL(dsi_enable_video_output);
4018 4021
4019void dsi_video_mode_disable(struct omap_dss_device *dssdev, int channel) 4022void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel)
4020{ 4023{
4021 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 4024 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
4022 4025
4023 dsi_if_enable(dsidev, false); 4026 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) {
4024 dsi_vc_enable(dsidev, channel, false); 4027 dsi_if_enable(dsidev, false);
4028 dsi_vc_enable(dsidev, channel, false);
4025 4029
4026 /* MODE, 0 = command mode */ 4030 /* MODE, 0 = command mode */
4027 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 0, 4, 4); 4031 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 0, 4, 4);
4028 4032
4029 dsi_vc_enable(dsidev, channel, true); 4033 dsi_vc_enable(dsidev, channel, true);
4030 dsi_if_enable(dsidev, true); 4034 dsi_if_enable(dsidev, true);
4035 }
4031 4036
4032 dss_mgr_disable(dssdev->manager); 4037 dss_mgr_disable(dssdev->manager);
4033} 4038}
4034EXPORT_SYMBOL(dsi_video_mode_disable); 4039EXPORT_SYMBOL(dsi_disable_video_output);
4035 4040
4036static void dsi_update_screen_dispc(struct omap_dss_device *dssdev, 4041static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
4037 u16 w, u16 h) 4042 u16 w, u16 h)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index eaeca89de152..25ef771b0a31 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -294,8 +294,8 @@ int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
294 u16 len); 294 u16 len);
295int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel); 295int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel);
296int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel); 296int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel);
297int dsi_video_mode_enable(struct omap_dss_device *dssdev, int channel); 297int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel);
298void dsi_video_mode_disable(struct omap_dss_device *dssdev, int channel); 298void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel);
299 299
300/* Board specific data */ 300/* Board specific data */
301struct omap_dss_board_info { 301struct omap_dss_board_info {