aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_crtc.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2014-04-03 06:11:54 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-04-14 05:34:14 -0400
commit506096a113832239ce763d20fab8e94f76d56266 (patch)
treeb14ae7f139afb20cb7ff4d7daf7b2e750bc87453 /drivers/gpu/drm/omapdrm/omap_crtc.c
parentc7aef12f344459961eb1e0ba10d184816ed42d99 (diff)
drm/omap: fix enabling/disabling of video pipeline
At the moment the omap_crtc_pre_apply() handles the enabling, disabling and configuring of encoders and panels separately from the CRTC (i.e. the overlay manager). However, this doesn't work correctly. The encoder driver has to be in control of its video input (i.e. the crtc) for correct operation. This problem causes bugs with (at least) HDMI: the HDMI encoder supplies pixel clock for DISPC, and DISPC supplies video stream for HDMI. The current code first enables the HDMI encoder, and CRTC after that. However, the encoder expects the video stream to start during the encoder's enable, and if it doesn't, there will be sync lost errors. The encoder enables its video source by calling src->enable(), and this call goes to omapdrm (omap_crtc_enable), but omapdrm doesn't do anything in that function. Similarly for disable, which goes to omap_crtc_disable(). This patch moves the code to setup and enable/disable the crtc to omap_crtc_enable. and omap_crtc_disable(). Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_crtc.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_crtc.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 61d1c4897a45..f59ef9359e66 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -121,13 +121,25 @@ static void omap_crtc_start_update(struct omap_overlay_manager *mgr)
121{ 121{
122} 122}
123 123
124static void set_enabled(struct drm_crtc *crtc, bool enable);
125
124static int omap_crtc_enable(struct omap_overlay_manager *mgr) 126static int omap_crtc_enable(struct omap_overlay_manager *mgr)
125{ 127{
128 struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
129
130 dispc_mgr_setup(omap_crtc->channel, &omap_crtc->info);
131 dispc_mgr_set_timings(omap_crtc->channel,
132 &omap_crtc->timings);
133 set_enabled(&omap_crtc->base, true);
134
126 return 0; 135 return 0;
127} 136}
128 137
129static void omap_crtc_disable(struct omap_overlay_manager *mgr) 138static void omap_crtc_disable(struct omap_overlay_manager *mgr)
130{ 139{
140 struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
141
142 set_enabled(&omap_crtc->base, false);
131} 143}
132 144
133static void omap_crtc_set_timings(struct omap_overlay_manager *mgr, 145static void omap_crtc_set_timings(struct omap_overlay_manager *mgr,
@@ -601,7 +613,6 @@ static void omap_crtc_pre_apply(struct omap_drm_apply *apply)
601 omap_crtc->current_encoder = encoder; 613 omap_crtc->current_encoder = encoder;
602 614
603 if (!omap_crtc->enabled) { 615 if (!omap_crtc->enabled) {
604 set_enabled(&omap_crtc->base, false);
605 if (encoder) 616 if (encoder)
606 omap_encoder_set_enabled(encoder, false); 617 omap_encoder_set_enabled(encoder, false);
607 } else { 618 } else {
@@ -610,13 +621,7 @@ static void omap_crtc_pre_apply(struct omap_drm_apply *apply)
610 omap_encoder_update(encoder, omap_crtc->mgr, 621 omap_encoder_update(encoder, omap_crtc->mgr,
611 &omap_crtc->timings); 622 &omap_crtc->timings);
612 omap_encoder_set_enabled(encoder, true); 623 omap_encoder_set_enabled(encoder, true);
613 omap_crtc->full_update = false;
614 } 624 }
615
616 dispc_mgr_setup(omap_crtc->channel, &omap_crtc->info);
617 dispc_mgr_set_timings(omap_crtc->channel,
618 &omap_crtc->timings);
619 set_enabled(&omap_crtc->base, true);
620 } 625 }
621 626
622 omap_crtc->full_update = false; 627 omap_crtc->full_update = false;