From patchwork Wed May 30 12:15:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maciej Purski X-Patchwork-Id: 10438837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3EE34601D3 for ; Wed, 30 May 2018 12:18:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2900828607 for ; Wed, 30 May 2018 12:18:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D92328733; Wed, 30 May 2018 12:18:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 530A428B12 for ; Wed, 30 May 2018 12:17:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753070AbeE3MQj (ORCPT ); Wed, 30 May 2018 08:16:39 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:34137 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751352AbeE3MQ3 (ORCPT ); Wed, 30 May 2018 08:16:29 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180530121627euoutp02cfc17c175e328a25e0a816c08828d47f~zazgMJDg00060000600euoutp02O; Wed, 30 May 2018 12:16:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180530121627euoutp02cfc17c175e328a25e0a816c08828d47f~zazgMJDg00060000600euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1527682587; bh=WQKrLup2hH6v5Qn15ttefGKHuEPFIQN6Z8pk0FlmaTc=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=Pl5Dztsyd4D07ikmJcMcEEJrmgKKvBcHykOV+uwp9TM2Ns9Po2XyXHtB6/YyENwIx 9f08elbZMmjbfBURud1yPubNAKKR6moiSi8CyQbnb5Tg+Un/S5nCmIkUpCh3gZ0t9I CVm0Uy7vLRE/5ELDAr5UYibxnYoPUYKKCuFGoM34= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180530121625eucas1p232f362b2186672bc1266341d53a357a5~zazfG8Glm1281612816eucas1p2s; Wed, 30 May 2018 12:16:25 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 99.2D.17380.9169E0B5; Wed, 30 May 2018 13:16:25 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180530121624eucas1p2678b6a5424cb8df286b6142cd3754b65~zazdxjWQt1444714447eucas1p2i; Wed, 30 May 2018 12:16:24 +0000 (GMT) X-AuditID: cbfec7f4-b4fc79c0000043e4-76-5b0e9619be7c Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 4D.2A.04183.8169E0B5; Wed, 30 May 2018 13:16:24 +0100 (BST) Received: from AMDC2075.DIGITAL.local ([106.120.51.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P9J00FMPJF35I90@eusync1.samsung.com>; Wed, 30 May 2018 13:16:24 +0100 (BST) From: Maciej Purski To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: David Airlie , Rob Herring , Mark Rutland , Thierry Reding , Kukjin Kim , Krzysztof Kozlowski , Archit Taneja , Andrzej Hajda , Laurent Pinchart , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Maciej Purski Subject: [PATCH v2 03/10] drm/exynos: move connector creation to attach callback Date: Wed, 30 May 2018 14:15:54 +0200 Message-id: <1527682561-1386-4-git-send-email-m.purski@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1527682561-1386-1-git-send-email-m.purski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSe0hTYRjG+7Zz2/LkYVp+XZAaKNHFbgZfFyxN4kARlQWVUR3zsGVus51m N7sZmtvSvNVWeU9n6cxaWqlpoZKUpYlRKZnBwFomVjOhKM159L/f8zwv7wVeSqpIxmdRh7RH eb2Wi1UScuzBs99ti2denRa51NzgjbrvtOEote25BCWmDODonrUSR/nNY96bX4MEyuxNx9CX jx0Yuuzsl6L29rskepX4jUTGjGISOZxvcdRZm0Mga3uDBBW4ujFU0dxDopJ3HRKUVN9MImuW i0C/a/Ow9dNZe54dsJ1pqRK25noPyd5IuYazjjIjwT4c/oSzveYWCXu/+CybVlUGWLfDf6t8 j3xtNB97KJ7XLwk5IFc7u4uJuJu+xysvvcPPATdjAjIKMsGweeQNaQJySsHcArCuqEIiCjeA g44/5GTV5+qeicAGoLGrDhPFKIAFRbWECVAUwSyA9ov7Pb4vUwbg/fcDwCOkzBUcvs7vxz2t fJjt0FF/d5wxJgB+d72SeJhmNkDrz1wgjvOHXW1GqaepjAmH5Y9DRDuLhIWmCJHDYU31qFRk H/i1pWpi0zmwM8uMiayDSX3OCf84bEhtxUVeA5taOsZZykyDmQ8s46MgQ8OUZIVYwsKS7OuE eKMFwNHk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jymMJ ufYFp1e32toFz0rPWvFoW/WFgM8fZVQXrE/6+2/+kVklSkvnVX4KzN46+U3GfPcIVoGZpR4b LsT/Vw9Umzp1ctcZObVyv5fr1p5x1Gu8LM5RxX5FiaU4I9FQi7moOBEAtuAUBHgCAAA= X-CMS-MailID: 20180530121624eucas1p2678b6a5424cb8df286b6142cd3754b65 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180530121624eucas1p2678b6a5424cb8df286b6142cd3754b65 References: <1527682561-1386-1-git-send-email-m.purski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current implementation assumes that the only possible peripheral device for DSIM is a panel. Using an output bridge should also be possible. If an output bridge in available, don't create a new connector. Instead add bridge to DSIM encdoer in dsi_host_attach(). Signed-off-by: Maciej Purski --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 35 +++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 85eb2262..7b50bad 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1501,7 +1501,28 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct exynos_dsi *dsi = host_to_dsi(host); - struct drm_device *drm = dsi->connector.dev; + struct drm_encoder *encoder = &dsi->encoder; + struct drm_device *drm = encoder->dev; + struct drm_bridge *out_bridge; + + out_bridge = of_drm_find_bridge(device->dev.of_node); + if (out_bridge) { + drm_bridge_attach(encoder, out_bridge, NULL); + } else { + int ret = exynos_dsi_create_connector(encoder); + + if (ret) { + DRM_ERROR("failed to create connector ret = %d\n", ret); + drm_encoder_cleanup(encoder); + return ret; + } + + dsi->panel = of_drm_find_panel(device->dev.of_node); + if (dsi->panel) { + drm_panel_attach(dsi->panel, &dsi->connector); + dsi->connector.status = connector_status_connected; + } + } /* * This is a temporary solution and should be made by more generic way. @@ -1520,11 +1541,6 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, dsi->lanes = device->lanes; dsi->format = device->format; dsi->mode_flags = device->mode_flags; - dsi->panel = of_drm_find_panel(device->dev.of_node); - if (dsi->panel) { - drm_panel_attach(dsi->panel, &dsi->connector); - dsi->connector.status = connector_status_connected; - } exynos_drm_crtc_get_by_type(drm, EXYNOS_DISPLAY_TYPE_LCD)->i80_mode = !(dsi->mode_flags & MIPI_DSI_MODE_VIDEO); @@ -1653,13 +1669,6 @@ static int exynos_dsi_bind(struct device *dev, struct device *master, if (ret < 0) return ret; - ret = exynos_dsi_create_connector(encoder); - if (ret) { - DRM_ERROR("failed to create connector ret = %d\n", ret); - drm_encoder_cleanup(encoder); - return ret; - } - if (dsi->mic_bridge_node) { mic_bridge = of_drm_find_bridge(dsi->mic_bridge_node); if (mic_bridge)