From patchwork Wed Jan 4 06:58:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hoegeun Kwon X-Patchwork-Id: 9496167 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 8902660413 for ; Wed, 4 Jan 2017 06:59:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A98C205A8 for ; Wed, 4 Jan 2017 06:59:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F81326CFF; Wed, 4 Jan 2017 06:59:31 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5CB9326C9B for ; Wed, 4 Jan 2017 06:59:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 276F56E1CD; Wed, 4 Jan 2017 06:59:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTPS id B39436E1C5 for ; Wed, 4 Jan 2017 06:59:03 +0000 (UTC) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJ800HG0U2CO4C0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 04 Jan 2017 15:59:00 +0900 (KST) Received: from epsmges1p3.samsung.com (unknown [182.195.40.64]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20170104065900epcas1p485f08edbb0d867fde7acac3d557d4b1e~Wf1dVqcVA0354703547epcas1p4D; Wed, 4 Jan 2017 06:59:00 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id AE.97.03670.43D9C685; Wed, 4 Jan 2017 15:59:00 +0900 (KST) Received: from epcpsbgm1new.samsung.com (u26.gpu120.samsung.co.kr [203.254.230.26]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20170104065859epcas1p1df9efb3844bd8e4e4d4bb0af0a229ca2~Wf1c6gI9T1283412834epcas1p1z; Wed, 4 Jan 2017 06:58:59 +0000 (GMT) X-AuditID: b6c32a37-f79116d000000e56-54-586c9d342347 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 35.14.28252.33D9C685; Wed, 4 Jan 2017 15:58:59 +0900 (KST) Received: from khg_DeskTop.10.32.193.11 ([10.113.63.38]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJ80007CU26RL90@mmp2.samsung.com>; Wed, 04 Jan 2017 15:58:59 +0900 (KST) From: Hoegeun Kwon To: robh@kernel.org, thierry.reding@gmail.com, airlied@linux.ie, kgene@kernel.org, krzk@kernel.org, inki.dae@samsung.com Subject: [PATCH v4 1/3] drm/exynos: mic: Add mode_set callback function Date: Wed, 04 Jan 2017 15:58:33 +0900 Message-id: <1483513115-3068-2-git-send-email-hoegeun.kwon@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1483513115-3068-1-git-send-email-hoegeun.kwon@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzVS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Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMIsWRmVeSWpSXmKPExsVy+t9jQV3juTkRBo+mGlvcWneO1aL33Ekm i+tfnrNazD8C5F75+p7N4v3yLjaLSfcnsFjc+NXGatH/+DWzxfnzG9gtLu+aw2Yx4/w+Jov/ e3awW/zcNY/Fgc9j56y77B6bVnWyeWz/9oDV4373cSaPvi2rGD0+b5ILYItys8lITUxJLVJI zUvOT8nMS7dVCg1x07VQUshLzE21VYrQ9Q0JUlIoS8wpBfKMDNCAg3OAe7CSvl2CW0b37vNM BZuFKq49PsbcwDiTv4uRg0NCwERi+XT3LkZOIFNM4sK99WxdjFwcQgKzGCWOL9vIDOH8YpT4 1n+cFaSKTUBX4mvPdSYQW0SgSuLBoaUsIDazwGdGicvLzUCGCgu4S1xcYwISZhFQlXi+6B9Y Ky9Q+PHV32wQy+QkTh6bDBbnFPCQeP//CJgtBFRzacEZxgmMvAsYGVYxSqQWJBcUJ6XnGual lusVJ+YWl+al6yXn525iBEfIM6kdjAd3uR9iFOBgVOLhXWGREyHEmlhWXJl7iFGCg1lJhHfn LKAQb0piZVVqUX58UWlOavEhRlOgwyYyS4km5wOjN68k3tDE3MTc2MDC3NLSxEhJnLdx9rNw IYH0xJLU7NTUgtQimD4mDk6pBsalyev/xdon3mEPuyl152fPrYRJpwt+bN6lWxEe/njfxGU1 MQ0eCjanK5jmudltPL48Se6qb4RZ1MTSlmv5i9Y33/x31H9hXk8oR3LkcQn19sXytdK79OvV jr1YGtW8UXbLT7X1j/d8+jYza+GLx8u2/dt5Q1Dz3q9tL+0evla+4/drjpGY0IbnSizFGYmG WsxFxYkAMEGxqKYCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170104065859epcas1p1df9efb3844bd8e4e4d4bb0af0a229ca2 X-Msg-Generator: CA X-Sender-IP: 203.254.230.26 X-Local-Sender: =?UTF-8?B?6raM7ZqM6re8G1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbUzMo7IKs7JuQKS/sgqzsm5A=?= X-Global-Sender: =?UTF-8?B?SG9lZ2V1biBLd29uG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtTMy9Bc3Npc3RhbnQgRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1NUQUYbQzEwVjgxMTE=?= CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-HopCount: 7 X-CMS-RootMailID: 20170104065859epcas1p1df9efb3844bd8e4e4d4bb0af0a229ca2 X-RootMTR: 20170104065859epcas1p1df9efb3844bd8e4e4d4bb0af0a229ca2 References: <1483513115-3068-1-git-send-email-hoegeun.kwon@samsung.com> Cc: devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, jh80.chung@samsung.com, cw00.choi@samsung.com, Hoegeun Kwon X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Before applying the patch, used the of_get_videomode function to parse the display-timings in the panel which is the child driver of dsi in the devicetree. this is wrong. So removed the of_get_videomode and fixed to get videomode struct through mode_set callback function. Signed-off-by: Hoegeun Kwon --- drivers/gpu/drm/exynos/exynos_drm_mic.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c index a0def0b..9a50ceb 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_mic.c +++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c @@ -286,13 +286,6 @@ static int parse_dt(struct exynos_mic *mic) } nodes[j++] = remote_node; - ret = of_get_videomode(remote_node, - &mic->vm, 0); - if (ret) { - DRM_ERROR("mic: failed to get videomode"); - goto exit; - } - break; default: DRM_ERROR("mic: Unknown endpoint from MIC"); @@ -329,6 +322,27 @@ static void mic_post_disable(struct drm_bridge *bridge) mutex_unlock(&mic_mutex); } +static void mic_mode_set(struct drm_bridge *bridge, + struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode) +{ + struct exynos_mic *mic = bridge->driver_private; + + mutex_lock(&mic_mutex); + if (mic->enabled) + goto already_enabled; + + drm_display_mode_to_videomode(mode, &mic->vm); + + if (!mic->i80_mode) + mic_set_porch_timing(mic); + mic_set_img_size(mic); + mic_set_output_timing(mic); + +already_enabled: + mutex_unlock(&mic_mutex); +} + static void mic_pre_enable(struct drm_bridge *bridge) { struct exynos_mic *mic = bridge->driver_private; @@ -355,10 +369,6 @@ static void mic_pre_enable(struct drm_bridge *bridge) goto turn_off_clks; } - if (!mic->i80_mode) - mic_set_porch_timing(mic); - mic_set_img_size(mic); - mic_set_output_timing(mic); mic_set_reg_on(mic, 1); mic->enabled = 1; mutex_unlock(&mic_mutex); @@ -377,6 +387,7 @@ static void mic_enable(struct drm_bridge *bridge) { } static const struct drm_bridge_funcs mic_bridge_funcs = { .disable = mic_disable, .post_disable = mic_post_disable, + .mode_set = mic_mode_set, .pre_enable = mic_pre_enable, .enable = mic_enable, };