drm/omap: Pass pipe pointer to omap_crtc_init()
[linux-2.6-block.git] / drivers / gpu / drm / omapdrm / omap_crtc.c
index 6c4d40b824e407fc45b648ddd01dd0f6e3d6ce53..f5bdb8de98f4474c038bd458db33f977221e2636 100644 (file)
@@ -474,8 +474,8 @@ static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc)
         * has been changed to the DRM model.
         */
 
-       for (i = 0; i < priv->num_encoders; ++i) {
-               struct drm_encoder *encoder = priv->encoders[i];
+       for (i = 0; i < priv->num_pipes; ++i) {
+               struct drm_encoder *encoder = priv->pipes[i].encoder;
 
                if (encoder->crtc == crtc) {
                        struct omap_dss_device *dssdev;
@@ -683,28 +683,26 @@ void omap_crtc_pre_init(struct omap_drm_private *priv)
 {
        memset(omap_crtcs, 0, sizeof(omap_crtcs));
 
-       dss_install_mgr_ops(&mgr_ops, priv);
+       dss_install_mgr_ops(priv->dss, &mgr_ops, priv);
 }
 
-void omap_crtc_pre_uninit(void)
+void omap_crtc_pre_uninit(struct omap_drm_private *priv)
 {
-       dss_uninstall_mgr_ops();
+       dss_uninstall_mgr_ops(priv->dss);
 }
 
 /* initialize crtc */
 struct drm_crtc *omap_crtc_init(struct drm_device *dev,
-               struct drm_plane *plane, struct omap_dss_device *dssdev)
+                               struct omap_drm_pipeline *pipe,
+                               struct drm_plane *plane)
 {
        struct omap_drm_private *priv = dev->dev_private;
        struct drm_crtc *crtc = NULL;
        struct omap_crtc *omap_crtc;
        enum omap_channel channel;
-       struct omap_dss_device *out;
        int ret;
 
-       out = omapdss_find_output_from_display(dssdev);
-       channel = out->dispc_channel;
-       omap_dss_put_device(out);
+       channel = pipe->output->dispc_channel;
 
        DBG("%s", channel_names[channel]);
 
@@ -727,7 +725,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
                                        &omap_crtc_funcs, NULL);
        if (ret < 0) {
                dev_err(dev->dev, "%s(): could not init crtc for: %s\n",
-                       __func__, dssdev->name);
+                       __func__, pipe->display->name);
                kfree(omap_crtc);
                return ERR_PTR(ret);
        }