From patchwork Thu Jan 5 06:45:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hoegeun Kwon X-Patchwork-Id: 9498509 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 A9B54606B5 for ; Thu, 5 Jan 2017 06:52:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97DC027C7A for ; Thu, 5 Jan 2017 06:52:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AF5F27F90; Thu, 5 Jan 2017 06:52:14 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 0688D27C7A for ; Thu, 5 Jan 2017 06:52:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755062AbdAEGsb (ORCPT ); Thu, 5 Jan 2017 01:48:31 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:45730 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755249AbdAEGqy (ORCPT ); Thu, 5 Jan 2017 01:46:54 -0500 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJA01XUXO4WIXB0@mailout4.samsung.com>; Thu, 05 Jan 2017 15:46:08 +0900 (KST) Received: from epsmges5p4.samsung.com (unknown [182.195.40.65]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20170105064608epcas1p1534a905aa365acf8fec35dae97436a24~WzTgeYWYj2926129261epcas1p1I; Thu, 5 Jan 2017 06:46:08 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p4.samsung.com (EPCPMTA) with SMTP id 52.1B.06849.0BBED685; Thu, 5 Jan 2017 15:46:08 +0900 (KST) Received: from epcpsbgm2new.samsung.com (u27.gpu120.samsung.co.kr [203.254.230.27]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20170105064607epcas5p3a5185e95807b28cc137842fce9a04ada~WzTgMa7OW0754607546epcas5p3I; Thu, 5 Jan 2017 06:46:07 +0000 (GMT) X-AuditID: b6c32a58-f79726d000001ac1-e5-586debb00d6c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id FF.80.28332.FABED685; Thu, 5 Jan 2017 15:46:07 +0900 (KST) Received: from khg_DeskTop.10.32.193.11 ([10.113.63.38]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJA002VGO4S5WB0@mmp1.samsung.com>; Thu, 05 Jan 2017 15:46:07 +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 Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, a.hajda@samsung.com, cw00.choi@samsung.com, jh80.chung@samsung.com, Hoegeun Kwon Subject: [PATCH v6 1/4] drm/exynos: mic: Add mode_set callback function Date: Thu, 05 Jan 2017 15:45:47 +0900 Message-id: <1483598750-15062-2-git-send-email-hoegeun.kwon@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1483598750-15062-1-git-send-email-hoegeun.kwon@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJ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7dHpNxRYml OCPRUIu5qDgRACERV698AwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMIsWRmVeSWpSXmKPExsVy+t9jAd31r3MjDG49MLK4te4cq0XvuZNM Fte/PGe1mH8EyL3y9T2bxfvlXWwWk+5PYLG48auN1aL/8Wtmi/PnN7BbXN41h81ixvl9TBb/ 9+xgt/i5ax6LA5/Hzll32T02repk89j+7QGrx/3u40wefVtWMXp83iQXwBblZpORmpiSWqSQ mpecn5KZl26rFBripmuhpJCXmJtqqxSh6xsSpKRQlphTCuQZGaABB+cA92AlfbsEt4zTT38y FywQqljw9zt7A2MPfxcjJ4eEgInEoa9nmCFsMYkL99azdTFycQgJLGWUWLtxLQuE84tR4sLu PkaQKjYBXYmvPdeZQGwRgSqJB4eWsoDYzAKfGSUuLzfrYuTgEBZwlzj8iBXEZBFQlVi6XBuk glfAQ2L+hRNQu+QkTh6bzApicwp4SjxffoUdxBYCqmmYu41lAiPvAkaGVYwSqQXJBcVJ6blG eanlesWJucWleel6yfm5mxjBEfJMegfj4V3uhxgFOBiVeHg7/uZECLEmlhVX5h5ilOBgVhLh tXieGyHEm5JYWZValB9fVJqTWnyI0RToronMUqLJ+cDozSuJNzQxNzE3NrAwt7Q0MVIS522c /SxcSCA9sSQ1OzW1ILUIpo+Jg1OqgXHJbOuH4c6LPbvPlp9bX/dhxXojNu4pDMtyJi/Mms8V KF67Kuh7dHJN2tMddyJ1xZ+oJ+m6Kk1nyuAoeb3soNXp4/ysa/tMtCT4ReUdnrjsMLDaqdBY FBxi3cglmP9FpL9pxnsuI5EVjIsauznXzLkhd69+39uAH58vxYuW7maYO01vcr1zjxJLcUai oRZzUXEiAK+RO3SmAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170105064607epcas5p3a5185e95807b28cc137842fce9a04ada X-Msg-Generator: CA X-Sender-IP: 203.254.230.27 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: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-HopCount: 7 X-CMS-RootMailID: 20170105064607epcas5p3a5185e95807b28cc137842fce9a04ada X-RootMTR: 20170105064607epcas5p3a5185e95807b28cc137842fce9a04ada References: <1483598750-15062-1-git-send-email-hoegeun.kwon@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 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 Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_mic.c | 30 +++++++++++++++++++----------- 1 file changed, 19 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..a0f459c 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,24 @@ 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); + + 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); + + mutex_unlock(&mic_mutex); +} + static void mic_pre_enable(struct drm_bridge *bridge) { struct exynos_mic *mic = bridge->driver_private; @@ -355,10 +366,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 +384,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, };