From patchwork Wed Jan 4 08:15:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hoegeun Kwon X-Patchwork-Id: 9496225 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 02634606B5 for ; Wed, 4 Jan 2017 08:16:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E43532711E for ; Wed, 4 Jan 2017 08:16:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D582F2780C; Wed, 4 Jan 2017 08:16:38 +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=ham 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 447412711E for ; Wed, 4 Jan 2017 08:16:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965003AbdADIQc (ORCPT ); Wed, 4 Jan 2017 03:16:32 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:59716 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756360AbdADIQ1 (ORCPT ); Wed, 4 Jan 2017 03:16:27 -0500 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJ800IU4XLM8560@mailout2.samsung.com>; Wed, 04 Jan 2017 17:15:22 +0900 (KST) Received: from epsmges1p9.samsung.com (unknown [182.195.40.64]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20170104081522epcas1p12c630d64a60d0dfdb51ff5ce17b0dca9~Wg4Im2DAc1558015580epcas1p17; Wed, 4 Jan 2017 08:15:22 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p9.samsung.com (Symantec Messaging Gateway) with SMTP id F9.DA.19919.A1FAC685; Wed, 4 Jan 2017 17:15:22 +0900 (KST) Received: from epcpsbgm1new.samsung.com (u26.gpu120.samsung.co.kr [203.254.230.26]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20170104081521epcas1p40d5fbfbe0600d0df05e77b36ce6a353f~Wg4IIvYS93131431314epcas1p4-; Wed, 4 Jan 2017 08:15:21 +0000 (GMT) X-AuditID: b6c32a3d-f79a36d000004dcf-7b-586caf1a35e5 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 22.2A.28252.91FAC685; Wed, 4 Jan 2017 17:15:21 +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 <0OJ800EFKXLILWA0@mmp1.samsung.com>; Wed, 04 Jan 2017 17:15:21 +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 v5 1/3] drm/exynos: mic: Add mode_set callback function Date: Wed, 04 Jan 2017 17:15:09 +0900 Message-id: <1483517711-23849-2-git-send-email-hoegeun.kwon@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1483517711-23849-1-git-send-email-hoegeun.kwon@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA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VNJVl+AwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCIsWRmVeSWpSXmKPExsVy+t9jAV3J9TkRBr2rdC1urTvHatF77iST xfUvz1kt5h8Bcq98fc9m8X55F5vFpPsTWCxu/Gpjteh//JrZ4vz5DewWl3fNYbOYcX4fk8X/ PTvYLX7umsfiwOexc9Zddo9NqzrZPLZ/e8Dqcb/7OJNH35ZVjB6fN8kFsEW52WSkJqakFimk 5iXnp2TmpdsqhYa46VooKeQl5qbaKkXo+oYEKSmUJeaUAnlGBmjAwTnAPVhJ3y7BLWPS/JWM Be8EK1rv/GVqYLzP18XIySEhYCLx8c5bJghbTOLCvfVsILaQwFJGiZZjLl2MXED2L0aJZ/NX gCXYBHQlvvZcB2sQEaiSeHBoKQuIzSzwmVHi8nIzEFtYwF2i+0IjM4jNIqAq8b/vNyuIzSvg IbHr8XmoZXISJ49NBotzCnhKvHy/nBlisYfE//97WScw8i5gZFjFKJFakFxQnJSea5iXWq5X nJhbXJqXrpecn7uJERwjz6R2MB7c5X6IUYCDUYmHd4VFToQQa2JZcWXuIUYJDmYlEd6rq4FC vCmJlVWpRfnxRaU5qcWHGE2BDpvILCWanA+M37ySeEMTcxNzYwMLc0tLEyMlcd7G2c/ChQTS E0tSs1NTC1KLYPqYODilGhj7t7WulxN1ZF1y+hnXkqUXZS0Pc029bFauYcuR25V0OO/ydK0S sXWvzUVZJbb0t01n9S0+GSU9uThP4jOL3w9ODvfJc6PiG6R6niYEN3Sd9T4YvLaxNJl95sp+ Jk/nqs0lrz60yBy6vinm11S9CrOeCzWWdZM9jH1m96/c6Gp8pk55x+G9l5RYijMSDbWYi4oT ATxjI5qnAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170104081521epcas1p40d5fbfbe0600d0df05e77b36ce6a353f 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: 20170104081521epcas1p40d5fbfbe0600d0df05e77b36ce6a353f X-RootMTR: 20170104081521epcas1p40d5fbfbe0600d0df05e77b36ce6a353f References: <1483517711-23849-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, };