drm/exynos: fix wrong pipe calculation for crtc
authorJoonyoung Shim <jy0922.shim@samsung.com>
Fri, 30 Jan 2015 07:43:01 +0000 (16:43 +0900)
committerInki Dae <inki.dae@samsung.com>
Sat, 7 Feb 2015 07:38:40 +0000 (16:38 +0900)
We get wrong pipe value for crtc since commit 93bca243ec96 ("drm/exynos:
remove struct exynos_drm_manager"). We should should increase pipe value
before call exynos_drm_crtc_create.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_fimd.c
drivers/gpu/drm/exynos/exynos_drm_vidi.c

index 682806ef4d337edb7748107a33ef138812616b49..39f7fa7b8d3469123fa7da23f3d251376ccff253 100644 (file)
@@ -1065,18 +1065,19 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
        struct drm_device *drm_dev = data;
        int ret;
 
-       ctx->crtc = exynos_drm_crtc_create(drm_dev, ctx->pipe,
-                                          EXYNOS_DISPLAY_TYPE_LCD,
-                                          &fimd_crtc_ops, ctx);
-       if (IS_ERR(ctx->crtc))
-               return PTR_ERR(ctx->crtc);
-
        ret = fimd_ctx_initialize(ctx, drm_dev);
        if (ret) {
                DRM_ERROR("fimd_ctx_initialize failed.\n");
                return ret;
        }
 
+       ctx->crtc = exynos_drm_crtc_create(drm_dev, ctx->pipe,
+                                          EXYNOS_DISPLAY_TYPE_LCD,
+                                          &fimd_crtc_ops, ctx);
+       if (IS_ERR(ctx->crtc)) {
+               fimd_ctx_remove(ctx);
+               return PTR_ERR(ctx->crtc);
+       }
 
        if (ctx->display)
                exynos_drm_create_enc_conn(drm_dev, ctx->display);
index 9c8300edd348434899178215e07b4ba3fa9f73c4..fb68d3c997c1b55c1b9cc0c4c50cf928364e7d11 100644 (file)
@@ -548,6 +548,8 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)
        struct drm_device *drm_dev = data;
        int ret;
 
+       vidi_ctx_initialize(ctx, drm_dev);
+
        ctx->crtc = exynos_drm_crtc_create(drm_dev, ctx->pipe,
                                           EXYNOS_DISPLAY_TYPE_VIDI,
                                           &vidi_crtc_ops, ctx);
@@ -556,8 +558,6 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)
                return PTR_ERR(ctx->crtc);
        }
 
-       vidi_ctx_initialize(ctx, drm_dev);
-
        ret = exynos_drm_create_enc_conn(drm_dev, &ctx->display);
        if (ret) {
                ctx->crtc->base.funcs->destroy(&ctx->crtc->base);