From patchwork Tue Jun 19 08:19:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maciej Purski X-Patchwork-Id: 10473727 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 9D74560230 for ; Tue, 19 Jun 2018 08:23:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C92F2855D for ; Tue, 19 Jun 2018 08:23:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 901F3285B0; Tue, 19 Jun 2018 08:23:44 +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 35DED2855D for ; Tue, 19 Jun 2018 08:23:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937443AbeFSIV7 (ORCPT ); Tue, 19 Jun 2018 04:21:59 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:44923 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756310AbeFSIUD (ORCPT ); Tue, 19 Jun 2018 04:20:03 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180619082001euoutp02c75b27a64f20d2c267248ae9d68dde20~5gexz7asy1480614806euoutp02d; Tue, 19 Jun 2018 08:20:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180619082001euoutp02c75b27a64f20d2c267248ae9d68dde20~5gexz7asy1480614806euoutp02d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1529396401; bh=g1pzJh3WA3mUqKmeX9FEzvLX8jXy2N5Lqa+rp0K1ySc=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=s2dy79bDC+Hr66drf8tG4X7wWHqKXS8HMbf2CdGLBnRNHsha6NjlSAJB6KUmn782R 2SFgGyB8Ylf6kvXUKRbNMHl9KFfodX2Zi8m1tNMeXjHXsn0p+4RWrcxIXx313qKzAF tSnkgLJguM9/iOsCnbB4HQP104KPIZro2fsfFCMs= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180619082000eucas1p2258c5a62acddd065b561f27e3455f23b~5gew7KWLR0178901789eucas1p2_; Tue, 19 Jun 2018 08:20:00 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id ED.AA.05700.FACB82B5; Tue, 19 Jun 2018 09:19:59 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180619081959eucas1p14aee2dfc0231d2f645e3c9071b92341e~5gewNjq1I3063530635eucas1p1Z; Tue, 19 Jun 2018 08:19:59 +0000 (GMT) X-AuditID: cbfec7f2-1c1ff70000011644-23-5b28bcafc308 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 6C.56.04178.FACB82B5; Tue, 19 Jun 2018 09:19:59 +0100 (BST) Received: from AMDC2075.DIGITAL.local ([106.120.51.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PAK00EJ59T2RV00@eusync4.samsung.com>; Tue, 19 Jun 2018 09:19:59 +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 v3 3/9] drm/exynos: enable out_bridge in exynos_dsi_enable() Date: Tue, 19 Jun 2018 10:19:24 +0200 Message-id: <1529396370-18761-4-git-send-email-m.purski@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1529396370-18761-1-git-send-email-m.purski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzVSayyVcRjvf96rM8feHeRPMjutMS3S+vBvtdZKej+w6UtE0ok3zLXzomTT SYlD5FKRTthciikcoiRGFlYcJ6XYDkk4bnNXPnRxvHz7/Z7f5dmzPTQmVRE2dGhkDKeIlIfL SDHe8H5du7+62dHvQGOLCxp60UugjN5uEUpKnSNQbX41gYo6NmafV+dJlDOShSPDsA5H98Zm MKTV1lCoJ2mWQqrsUgppxgYI1N+kJlG+tkWEiqeGcPS8Q0+hsq86EUp+20Gh/NwpEq03FeLH LdmqwirA9mdmiNjXBXqKfZz6iGA1lSqSbVz7TrAj6Z0itq70BptZXwnYZY2dl9hXfDSICw+N 4xQuxy6KQ1r7PpLRS8y1rrUGUgkyzdKACQ2ZQ3C6S42nATEtZZ4BODxuoASyDGByXhu+7Uop bBcJQjmAWfOLW65/AKpKjBGaJhknWJUSYJxbMJUA1n2bA0aCMQ8I2Fc0QxirzBkP+OPm4mYt zuyFy6oayogljBus0GQTwjo7ONirwozYhDkFC5782lwNmVwK6rsekoLJDS7Pj24FzOF0Zz0l YFuoSm0TCTgBVkw9xYWwEsAVfT8mCEfgu07dZ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OEu5SpV4NNWy424I 7Z8Y2BG3I7Fxptr5zrmvly0NeFWRtz3Sdt0XJp0HL+SibryY+qLY9Rvr/e/HPM7JpH79+Lz+ iPDZIJu4uiJ9w3UOqznuTRH4e5B18fHlBS67/R3TvZVYijMSDbWYi4oTAY/Tvw14AgAA X-CMS-MailID: 20180619081959eucas1p14aee2dfc0231d2f645e3c9071b92341e X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180619081959eucas1p14aee2dfc0231d2f645e3c9071b92341e References: <1529396370-18761-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 As the out bridge will not be enabled directly by the framework, it should be enabled by DSI. Exynos_dsi_enable() should handle a case, when there is an out_bridge connected as a DSI peripheral. Signed-off-by: Maciej Purski --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 34 +++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index c0408c0..8aa7ace 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1386,25 +1386,33 @@ static void exynos_dsi_enable(struct drm_encoder *encoder) dsi->state |= DSIM_STATE_ENABLED; - ret = drm_panel_prepare(dsi->panel); - if (ret < 0) { - dsi->state &= ~DSIM_STATE_ENABLED; - pm_runtime_put_sync(dsi->dev); - return; + if (dsi->panel) { + ret = drm_panel_prepare(dsi->panel); + if (ret < 0) { + dsi->state &= ~DSIM_STATE_ENABLED; + return; + } } + if (dsi->out_bridge) + drm_bridge_pre_enable(dsi->out_bridge); + exynos_dsi_set_display_mode(dsi); exynos_dsi_set_display_enable(dsi, true); - ret = drm_panel_enable(dsi->panel); - if (ret < 0) { - dsi->state &= ~DSIM_STATE_ENABLED; - exynos_dsi_set_display_enable(dsi, false); - drm_panel_unprepare(dsi->panel); - pm_runtime_put_sync(dsi->dev); - return; + if (dsi->panel) { + ret = drm_panel_enable(dsi->panel); + if (ret < 0) { + dsi->state &= ~DSIM_STATE_ENABLED; + exynos_dsi_set_display_enable(dsi, false); + drm_panel_unprepare(dsi->panel); + return; + } } + if (dsi->out_bridge) + drm_bridge_enable(dsi->out_bridge); + dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE; } @@ -1418,8 +1426,10 @@ static void exynos_dsi_disable(struct drm_encoder *encoder) dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE; drm_panel_disable(dsi->panel); + drm_bridge_disable(dsi->out_bridge); exynos_dsi_set_display_enable(dsi, false); drm_panel_unprepare(dsi->panel); + drm_bridge_post_disable(dsi->out_bridge); dsi->state &= ~DSIM_STATE_ENABLED;