diff options
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_drv.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_drv.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index f10e5053580b..0052f151bf7a 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c | |||
@@ -157,11 +157,14 @@ static void omap_disconnect_pipelines(struct drm_device *ddev) | |||
157 | unsigned int i; | 157 | unsigned int i; |
158 | 158 | ||
159 | for (i = 0; i < priv->num_pipes; i++) { | 159 | for (i = 0; i < priv->num_pipes; i++) { |
160 | struct omap_dss_device *display = priv->pipes[i].display; | 160 | struct omap_drm_pipeline *pipe = &priv->pipes[i]; |
161 | |||
162 | omapdss_device_disconnect(NULL, pipe->output); | ||
161 | 163 | ||
162 | omapdss_device_disconnect(display, NULL); | 164 | omapdss_device_put(pipe->output); |
163 | priv->pipes[i].display = NULL; | 165 | omapdss_device_put(pipe->display); |
164 | omapdss_device_put(display); | 166 | pipe->output = NULL; |
167 | pipe->display = NULL; | ||
165 | } | 168 | } |
166 | 169 | ||
167 | priv->num_pipes = 0; | 170 | priv->num_pipes = 0; |
@@ -182,26 +185,30 @@ static int omap_compare_pipes(const void *a, const void *b) | |||
182 | static int omap_connect_pipelines(struct drm_device *ddev) | 185 | static int omap_connect_pipelines(struct drm_device *ddev) |
183 | { | 186 | { |
184 | struct omap_drm_private *priv = ddev->dev_private; | 187 | struct omap_drm_private *priv = ddev->dev_private; |
185 | struct omap_dss_device *display = NULL; | 188 | struct omap_dss_device *output = NULL; |
186 | int r; | 189 | int r; |
187 | 190 | ||
188 | if (!omapdss_stack_is_ready()) | 191 | if (!omapdss_stack_is_ready()) |
189 | return -EPROBE_DEFER; | 192 | return -EPROBE_DEFER; |
190 | 193 | ||
191 | for_each_dss_display(display) { | 194 | for_each_dss_output(output) { |
192 | r = omapdss_device_connect(priv->dss, display, NULL); | 195 | r = omapdss_device_connect(priv->dss, NULL, output); |
193 | if (r == -EPROBE_DEFER) { | 196 | if (r == -EPROBE_DEFER) { |
194 | omapdss_device_put(display); | 197 | omapdss_device_put(output); |
195 | goto cleanup; | 198 | goto cleanup; |
196 | } else if (r) { | 199 | } else if (r) { |
197 | dev_warn(display->dev, "could not connect display: %s\n", | 200 | dev_warn(output->dev, "could not connect output %s\n", |
198 | display->name); | 201 | output->name); |
199 | } else { | 202 | } else { |
200 | omapdss_device_get(display); | 203 | struct omap_drm_pipeline *pipe; |
201 | priv->pipes[priv->num_pipes++].display = display; | 204 | |
205 | pipe = &priv->pipes[priv->num_pipes++]; | ||
206 | pipe->output = omapdss_device_get(output); | ||
207 | pipe->display = omapdss_display_get(output); | ||
208 | |||
202 | if (priv->num_pipes == ARRAY_SIZE(priv->pipes)) { | 209 | if (priv->num_pipes == ARRAY_SIZE(priv->pipes)) { |
203 | /* To balance the 'for_each_dss_display' loop */ | 210 | /* To balance the 'for_each_dss_output' loop */ |
204 | omapdss_device_put(display); | 211 | omapdss_device_put(output); |
205 | break; | 212 | break; |
206 | } | 213 | } |
207 | } | 214 | } |