aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_crtc.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-05-08 09:23:32 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-06-17 07:00:43 -0400
commita7e71e7f9fc7924921081aa55ceafca00d2c9f49 (patch)
treea7aacbb4520023a99d268c0e859a483049d1d467 /drivers/gpu/drm/omapdrm/omap_crtc.c
parent04b1fc0291674666110fffd09b30d8304aaa4602 (diff)
OMAPDSS: Implement display (dis)connect support
We currently have two steps in panel initialization and startup: probing and enabling. After the panel has been probed, it's ready and can be configured and later enabled. This model is not enough with more complex display pipelines, where we may have, for example, two panels, of which only one can be used at a time, connected to the same video output. To support that kind of scenarios, we need to add new step to the initialization: connect. This patch adds support for connecting and disconnecting panels. After probe, but before connect, no panel ops should be called. When the connect is called, a proper video pipeline is established, and the panel is ready for use. If some part in the video pipeline is already connected (by some other panel), the connect call fails. One key difference with the old style setup is that connect() handles also connecting to the overlay manager. This means that the omapfb (or omapdrm) no longer needs to figure out which overlay manager to use, but it can just call connect() on the panel, and the proper overlay manager is connected by omapdss. This also allows us to add back the support for dynamic switching between two exclusive panels. However, the current panel device model is not changed to support this, as the new device model is implemented in the following patches and the old model will be removed. The new device model supports dynamic switching. 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.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 02075bfcd8fd..b2ab2f5d3cb9 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -94,6 +94,28 @@ uint32_t pipe2vbl(struct drm_crtc *crtc)
94static struct omap_crtc *omap_crtcs[8]; 94static struct omap_crtc *omap_crtcs[8];
95 95
96/* we can probably ignore these until we support command-mode panels: */ 96/* we can probably ignore these until we support command-mode panels: */
97static int omap_crtc_connect(struct omap_overlay_manager *mgr,
98 struct omap_dss_output *dst)
99{
100 if (mgr->output)
101 return -EINVAL;
102
103 if ((mgr->supported_outputs & dst->id) == 0)
104 return -EINVAL;
105
106 dst->manager = mgr;
107 mgr->output = dst;
108
109 return 0;
110}
111
112static void omap_crtc_disconnect(struct omap_overlay_manager *mgr,
113 struct omap_dss_output *dst)
114{
115 mgr->output->manager = NULL;
116 mgr->output = NULL;
117}
118
97static void omap_crtc_start_update(struct omap_overlay_manager *mgr) 119static void omap_crtc_start_update(struct omap_overlay_manager *mgr)
98{ 120{
99} 121}
@@ -138,6 +160,8 @@ static void omap_crtc_unregister_framedone_handler(
138} 160}
139 161
140static const struct dss_mgr_ops mgr_ops = { 162static const struct dss_mgr_ops mgr_ops = {
163 .connect = omap_crtc_connect,
164 .disconnect = omap_crtc_disconnect,
141 .start_update = omap_crtc_start_update, 165 .start_update = omap_crtc_start_update,
142 .enable = omap_crtc_enable, 166 .enable = omap_crtc_enable,
143 .disable = omap_crtc_disable, 167 .disable = omap_crtc_disable,