diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 0fe981bc693b414168aab684ddb1d4720e99e1ca..224b9af70224a417045bcfc2b430d5ceeb3e150d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -299,7 +299,8 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc) drm_object_attach_property(&crtc->base, prop, 0); } -int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe) +int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe, + enum exynos_drm_output_type type) { struct exynos_drm_crtc *exynos_crtc; struct drm_plane *plane; @@ -317,6 +318,7 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe) exynos_crtc->dpms = DRM_MODE_DPMS_OFF; exynos_crtc->manager = manager; exynos_crtc->pipe = pipe; + exynos_crtc->type = type; plane = exynos_plane_init(manager->drm_dev, 1 << pipe, DRM_PLANE_TYPE_PRIMARY); if (IS_ERR(plane)) { @@ -435,7 +437,7 @@ int exynos_drm_crtc_get_pipe_from_type(struct drm_device *drm_dev, struct exynos_drm_crtc *exynos_crtc; exynos_crtc = to_exynos_crtc(crtc); - if (exynos_crtc->manager->type == out_type) + if (exynos_crtc->type == out_type) return exynos_crtc->pipe; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.h b/drivers/gpu/drm/exynos/exynos_drm_crtc.h index f1bee84530416d34cbff28800f32c5a357731696..a705941527d16051a9c422509e86f2816521b4e3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.h +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.h @@ -17,7 +17,8 @@ #include "exynos_drm_drv.h" -int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe); +int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe, + enum exynos_drm_output_type type); int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe); void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe); void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe); diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 1d024c0421a89e122f54f230983e3a8e0c075160..a3ae95f1a40bcb6108ec5b0a71ea7dc938d4acd0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -204,7 +204,6 @@ struct exynos_drm_manager_ops { * Exynos drm common manager structure, maps 1:1 with a crtc * * @list: the list entry for this manager - * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI. * @drm_dev: pointer to the drm device * @crtc: crtc object. * @ops: pointer to callbacks for exynos drm specific functionality @@ -212,7 +211,6 @@ struct exynos_drm_manager_ops { */ struct exynos_drm_manager { struct list_head list; - enum exynos_drm_output_type type; struct drm_device *drm_dev; struct drm_crtc *crtc; struct exynos_drm_manager_ops *ops; @@ -228,6 +226,7 @@ enum exynos_crtc_mode { * * @base: crtc object. * @manager: the manager associated with this crtc + * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI. * @pipe: a crtc index created at load() with a new crtc object creation * and the crtc object would be set to private->crtc array * to get a crtc object corresponding to this pipe from private->crtc @@ -241,6 +240,7 @@ enum exynos_crtc_mode { struct exynos_drm_crtc { struct drm_crtc base; struct exynos_drm_manager *manager; + enum exynos_drm_output_type type; unsigned int pipe; unsigned int dpms; enum exynos_crtc_mode mode; diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 4df151ca74f3308c2446fc2cff4c830a3dd6d7e7..1a6e354a9f2dbffc854d37b27e54dbd4297ad46d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -1076,7 +1076,8 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) struct drm_device *drm_dev = data; fimd_mgr_initialize(&ctx->manager, drm_dev); - exynos_drm_crtc_create(&ctx->manager, ctx->pipe); + exynos_drm_crtc_create(&ctx->manager, ctx->pipe, + EXYNOS_DISPLAY_TYPE_LCD); if (ctx->display) exynos_drm_create_enc_conn(drm_dev, ctx->display); @@ -1117,11 +1118,10 @@ static int fimd_probe(struct platform_device *pdev) if (!ctx) return -ENOMEM; - ctx->manager.type = EXYNOS_DISPLAY_TYPE_LCD; ctx->manager.ops = &fimd_manager_ops; ret = exynos_drm_component_add(dev, EXYNOS_DEVICE_TYPE_CRTC, - ctx->manager.type); + EXYNOS_DISPLAY_TYPE_LCD); if (ret) return ret; diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index 785d2fe47fe04064ffe0d959b358c05551787eb8..3cee0fd8f626765be7cdc1dfab8d4b75459b3b7a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c @@ -558,7 +558,8 @@ static int vidi_bind(struct device *dev, struct device *master, void *data) vidi_mgr_initialize(&ctx->manager, drm_dev); - ret = exynos_drm_crtc_create(&ctx->manager, ctx->pipe); + ret = exynos_drm_crtc_create(&ctx->manager, ctx->pipe, + EXYNOS_DISPLAY_TYPE_VIDI); if (ret) { DRM_ERROR("failed to create crtc.\n"); return ret; @@ -593,7 +594,6 @@ static int vidi_probe(struct platform_device *pdev) if (!ctx) return -ENOMEM; - ctx->manager.type = EXYNOS_DISPLAY_TYPE_VIDI; ctx->manager.ops = &vidi_manager_ops; ctx->display.type = EXYNOS_DISPLAY_TYPE_VIDI; ctx->display.ops = &vidi_display_ops; @@ -601,7 +601,7 @@ static int vidi_probe(struct platform_device *pdev) ctx->pdev = pdev; ret = exynos_drm_component_add(&pdev->dev, EXYNOS_DEVICE_TYPE_CRTC, - ctx->manager.type); + EXYNOS_DISPLAY_TYPE_VIDI); if (ret) return ret; diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 57c4622f9d41d2cc8fd0f889b28a58c1a68b7094..50ae1e3d9578254dd5b6cd9671245b6887fa8af3 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -1261,7 +1261,8 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data) if (ret) return ret; - ret = exynos_drm_crtc_create(&ctx->manager, ctx->pipe); + ret = exynos_drm_crtc_create(&ctx->manager, ctx->pipe, + EXYNOS_DISPLAY_TYPE_HDMI); if (ret) { mixer_mgr_remove(&ctx->manager); return ret; @@ -1297,7 +1298,6 @@ static int mixer_probe(struct platform_device *pdev) mutex_init(&ctx->mixer_mutex); - ctx->manager.type = EXYNOS_DISPLAY_TYPE_HDMI; ctx->manager.ops = &mixer_manager_ops; if (dev->of_node) { @@ -1321,7 +1321,7 @@ static int mixer_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ctx); ret = exynos_drm_component_add(&pdev->dev, EXYNOS_DEVICE_TYPE_CRTC, - ctx->manager.type); + EXYNOS_DISPLAY_TYPE_HDMI); if (ret) return ret;