aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_drv.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_drv.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_drv.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index ff9b49276b81..c65dd0d6b01d 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -97,6 +97,7 @@ static int omap_modeset_init(struct drm_device *dev)
97 int num_mgrs = dss_feat_get_num_mgrs(); 97 int num_mgrs = dss_feat_get_num_mgrs();
98 int num_crtcs; 98 int num_crtcs;
99 int i, id = 0; 99 int i, id = 0;
100 int r;
100 101
101 omap_crtc_pre_init(); 102 omap_crtc_pre_init();
102 103
@@ -118,6 +119,7 @@ static int omap_modeset_init(struct drm_device *dev)
118 struct drm_connector *connector; 119 struct drm_connector *connector;
119 struct drm_encoder *encoder; 120 struct drm_encoder *encoder;
120 enum omap_channel channel; 121 enum omap_channel channel;
122 struct omap_overlay_manager *mgr;
121 123
122 if (!dssdev->driver) { 124 if (!dssdev->driver) {
123 dev_warn(dev->dev, "%s has no driver.. skipping it\n", 125 dev_warn(dev->dev, "%s has no driver.. skipping it\n",
@@ -133,6 +135,13 @@ static int omap_modeset_init(struct drm_device *dev)
133 continue; 135 continue;
134 } 136 }
135 137
138 r = dssdev->driver->connect(dssdev);
139 if (r) {
140 dev_err(dev->dev, "could not connect display: %s\n",
141 dssdev->name);
142 continue;
143 }
144
136 encoder = omap_encoder_init(dev, dssdev); 145 encoder = omap_encoder_init(dev, dssdev);
137 146
138 if (!encoder) { 147 if (!encoder) {
@@ -174,8 +183,9 @@ static int omap_modeset_init(struct drm_device *dev)
174 * other possible channels to which the encoder can connect are 183 * other possible channels to which the encoder can connect are
175 * not considered. 184 * not considered.
176 */ 185 */
177 channel = dssdev->output->dispc_channel;
178 186
187 mgr = omapdss_find_mgr_from_display(dssdev);
188 channel = mgr->id;
179 /* 189 /*
180 * if this channel hasn't already been taken by a previously 190 * if this channel hasn't already been taken by a previously
181 * allocated crtc, we create a new crtc for it 191 * allocated crtc, we create a new crtc for it