aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_crtc.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-05-14 03:55:19 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-06-17 07:00:43 -0400
commit04b1fc0291674666110fffd09b30d8304aaa4602 (patch)
tree9213fcba31fffe4f0e932492481480f6653a33ad /drivers/gpu/drm/omapdrm/omap_crtc.c
parent7f7cdbd6883fd58cfc4e538d451b455ca849bd63 (diff)
OMAPDRM: fix overlay manager handling
Currently omapdrm creates crtcs, which map directly to DSS overlay managers, only on demand at init time. This would make it difficult to manage connecting the display entities in the future, as the code cannot just search for a suitable overlay manager. We cannot fix this the sane way, which would be to create crtcs for each overlay manager, because we need an overlay for each crtc. With limited number of overlays, that's not possible. So the solution for now is to detach the overlay manager from the crtc. crtcs are still created on demand at init time, but all overlay managers are always initialized by the omapdss. This way we can create and connect whole display pipelines from the overlay manager to the display, regardless of which crtcs omapdrm would create. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_crtc.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_crtc.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 79b200aee18a..02075bfcd8fd 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -40,7 +40,7 @@ struct omap_crtc {
40 * mgr->id.) Eventually this will be replaced w/ something 40 * mgr->id.) Eventually this will be replaced w/ something
41 * more common-panel-framework-y 41 * more common-panel-framework-y
42 */ 42 */
43 struct omap_overlay_manager mgr; 43 struct omap_overlay_manager *mgr;
44 44
45 struct omap_video_timings timings; 45 struct omap_video_timings timings;
46 bool enabled; 46 bool enabled;
@@ -90,6 +90,9 @@ uint32_t pipe2vbl(struct drm_crtc *crtc)
90 * job of sequencing the setup of the video pipe in the proper order 90 * job of sequencing the setup of the video pipe in the proper order
91 */ 91 */
92 92
93/* ovl-mgr-id -> crtc */
94static struct omap_crtc *omap_crtcs[8];
95
93/* we can probably ignore these until we support command-mode panels: */ 96/* we can probably ignore these until we support command-mode panels: */
94static void omap_crtc_start_update(struct omap_overlay_manager *mgr) 97static void omap_crtc_start_update(struct omap_overlay_manager *mgr)
95{ 98{
@@ -107,7 +110,7 @@ static void omap_crtc_disable(struct omap_overlay_manager *mgr)
107static void omap_crtc_set_timings(struct omap_overlay_manager *mgr, 110static void omap_crtc_set_timings(struct omap_overlay_manager *mgr,
108 const struct omap_video_timings *timings) 111 const struct omap_video_timings *timings)
109{ 112{
110 struct omap_crtc *omap_crtc = container_of(mgr, struct omap_crtc, mgr); 113 struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
111 DBG("%s", omap_crtc->name); 114 DBG("%s", omap_crtc->name);
112 omap_crtc->timings = *timings; 115 omap_crtc->timings = *timings;
113 omap_crtc->full_update = true; 116 omap_crtc->full_update = true;
@@ -116,7 +119,7 @@ static void omap_crtc_set_timings(struct omap_overlay_manager *mgr,
116static void omap_crtc_set_lcd_config(struct omap_overlay_manager *mgr, 119static void omap_crtc_set_lcd_config(struct omap_overlay_manager *mgr,
117 const struct dss_lcd_mgr_config *config) 120 const struct dss_lcd_mgr_config *config)
118{ 121{
119 struct omap_crtc *omap_crtc = container_of(mgr, struct omap_crtc, mgr); 122 struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
120 DBG("%s", omap_crtc->name); 123 DBG("%s", omap_crtc->name);
121 dispc_mgr_set_lcd_config(omap_crtc->channel, config); 124 dispc_mgr_set_lcd_config(omap_crtc->channel, config);
122} 125}
@@ -569,7 +572,7 @@ static void omap_crtc_pre_apply(struct omap_drm_apply *apply)
569 } else { 572 } else {
570 if (encoder) { 573 if (encoder) {
571 omap_encoder_set_enabled(encoder, false); 574 omap_encoder_set_enabled(encoder, false);
572 omap_encoder_update(encoder, &omap_crtc->mgr, 575 omap_encoder_update(encoder, omap_crtc->mgr,
573 &omap_crtc->timings); 576 &omap_crtc->timings);
574 omap_encoder_set_enabled(encoder, true); 577 omap_encoder_set_enabled(encoder, true);
575 omap_crtc->full_update = false; 578 omap_crtc->full_update = false;
@@ -595,6 +598,11 @@ static const char *channel_names[] = {
595 [OMAP_DSS_CHANNEL_LCD2] = "lcd2", 598 [OMAP_DSS_CHANNEL_LCD2] = "lcd2",
596}; 599};
597 600
601void omap_crtc_pre_init(void)
602{
603 dss_install_mgr_ops(&mgr_ops);
604}
605
598/* initialize crtc */ 606/* initialize crtc */
599struct drm_crtc *omap_crtc_init(struct drm_device *dev, 607struct drm_crtc *omap_crtc_init(struct drm_device *dev,
600 struct drm_plane *plane, enum omap_channel channel, int id) 608 struct drm_plane *plane, enum omap_channel channel, int id)
@@ -635,9 +643,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
635 omap_irq_register(dev, &omap_crtc->error_irq); 643 omap_irq_register(dev, &omap_crtc->error_irq);
636 644
637 /* temporary: */ 645 /* temporary: */
638 omap_crtc->mgr.id = channel; 646 omap_crtc->mgr = omap_dss_get_overlay_manager(channel);
639
640 dss_install_mgr_ops(&mgr_ops);
641 647
642 /* TODO: fix hard-coded setup.. add properties! */ 648 /* TODO: fix hard-coded setup.. add properties! */
643 info = &omap_crtc->info; 649 info = &omap_crtc->info;
@@ -651,6 +657,8 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
651 657
652 omap_plane_install_properties(omap_crtc->plane, &crtc->base); 658 omap_plane_install_properties(omap_crtc->plane, &crtc->base);
653 659
660 omap_crtcs[channel] = omap_crtc;
661
654 return crtc; 662 return crtc;
655 663
656fail: 664fail: