From patchwork Mon May 28 09:47:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maciej Purski X-Patchwork-Id: 10430353 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 D20F1602CC for ; Mon, 28 May 2018 09:49:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3AE5289DD for ; Mon, 28 May 2018 09:49:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B853B28B97; Mon, 28 May 2018 09:49:00 +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 5365C28B59 for ; Mon, 28 May 2018 09:49:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932150AbeE1Jrj (ORCPT ); Mon, 28 May 2018 05:47:39 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55016 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754216AbeE1Jr2 (ORCPT ); Mon, 28 May 2018 05:47:28 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180528094726euoutp0128457152d56b120324682396e459fe57~yxe04Vyfp1961319613euoutp01S; Mon, 28 May 2018 09:47:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180528094726euoutp0128457152d56b120324682396e459fe57~yxe04Vyfp1961319613euoutp01S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1527500846; bh=tgWBJZpDU+n0IgIu/F48VBpTyD2n/7/dOfZYaND2kJ4=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=ahWYItGdNk2TzDZfBnB0vZ50AaDSrdEYR+fHarvJS79zpYzsKJJqNYh94AaCISAxA q4g3/PzZXw029clo+ndKVAOYQy+R1adAAoJJi/6ORtl7YqC7/X0A0Gk0ppLHRB6RWH kUXI7gAFbewfvhMsexy26bGTKS068b32BmIaeXZY= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180528094725eucas1p23a403f794ddcf34c2793c02799c69e8f~yxe0FWPuo2641626416eucas1p2_; Mon, 28 May 2018 09:47:25 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id A5.F7.10409.D20DB0B5; Mon, 28 May 2018 10:47:25 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180528094724eucas1p17a37e06002ed96d97aaca87231f13bbb~yxezLagL21859818598eucas1p1r; Mon, 28 May 2018 09:47:24 +0000 (GMT) X-AuditID: cbfec7f5-b45ff700000028a9-fb-5b0bd02d94d5 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id A9.61.04178.C20DB0B5; Mon, 28 May 2018 10:47: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 <0P9F00D27N6R5P70@eusync1.samsung.com>; Mon, 28 May 2018 10:47: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 03/12] drm/exynos: move connector creation to attach callback Date: Mon, 28 May 2018 11:47:07 +0200 Message-id: <1527500833-16005-4-git-send-email-m.purski@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1527500833-16005-1-git-send-email-m.purski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSe0gUURjFvTszO+PW2rQa3jTEFsoQtKKCG2YPSBglsCgolLTVnVbRVdvx /Ue+Unct31jrA11K0zaf66Pc0EwlSfOVlWaYmSA+UTIFSzTX0f9+3/nOPYcPLoVJUgkbKjAk nFWFyIKlQhHe9H6t38lpYI/3iYENAo1W9xEove+DACWqFwhUp60hUEnnlvZ5ZVGIcsazcDT9 YxBHmZNzGOrvryVRb+I8iTTZpSQyTH4l0JCxSIi0/a0CpJsZxVFV5xiJyoYHBSi5pZNE2twZ IVozFuMXDzCVxZWAGcpIFzDNBWMkU6jOJxiDXiNkXq3+JJjxh10Cpr40jslo0ANm2WB3VeQl OidngwMjWdXx83dEAfmFRjzsqVW0oTYLjwe/6TRgTkH6NCw3NOBpQERJ6AoAdYVLQn5YBrCu vAnbdfWkV2L84jmAH5Obd1ybAC62DZNpgKKEtCOsTPU16Va0HsD6kQVgGjA6j4ADJXOEKcqS 9oQVCTnAxDh9BBqLG0gTi+nLMKP6GeDr7OC3Ps12tTntBodaUrbbIJ1JwuKZMqGpDW49+N5h wfst4WwXnwPpQ1CjfifgORQmT03u6NGwNb2H4NkFdnQNbjNGW8CcpicYHymG6hQJb2GgPnGT 4I/UAtj24C2eB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GN6cxZP9c11cZr8/IppYv4Ve1fvnzY34Krx/nim+W8zp+fcOf0v3Oe96vc2JWM9 V2P3nOTChO59aW7L/upxP3w+4X6G99/Xn2qi/ZRYijMSDbWYi4oTAaeOMp95AgAA X-CMS-MailID: 20180528094724eucas1p17a37e06002ed96d97aaca87231f13bbb X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180528094724eucas1p17a37e06002ed96d97aaca87231f13bbb References: <1527500833-16005-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 94460b0..8957faf 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1498,7 +1498,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. @@ -1517,11 +1538,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); @@ -1650,13 +1666,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)