From patchwork Fri Sep 29 10:05:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 9977425 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 B2E5060329 for ; Fri, 29 Sep 2017 10:05:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACB9E2967C for ; Fri, 29 Sep 2017 10:05:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A18A829807; Fri, 29 Sep 2017 10:05:59 +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 1AB2C2967C for ; Fri, 29 Sep 2017 10:05:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750709AbdI2KF6 (ORCPT ); Fri, 29 Sep 2017 06:05:58 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:42661 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752050AbdI2KFx (ORCPT ); Fri, 29 Sep 2017 06:05:53 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20170929100551euoutp02e6c9dce8e383a3ea73bb4180e868552e~ozRGtRTLd0289302893euoutp02S; Fri, 29 Sep 2017 10:05:51 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170929100550eucas1p2364fa722609fa69e0f11a49c36099e4a~ozRGCC0sQ1847618476eucas1p2o; Fri, 29 Sep 2017 10:05:50 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 19.67.12743.EFA1EC95; Fri, 29 Sep 2017 11:05:50 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170929100549eucas1p2053fdf47957c11fa39d0e026267f088c~ozRFMjTR31409314093eucas1p2O; Fri, 29 Sep 2017 10:05:49 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d0000031c7-55-59ce1afe318f Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FC.A8.20118.DFA1EC95; Fri, 29 Sep 2017 11:05:49 +0100 (BST) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OX100L2HDDLSN30@eusync4.samsung.com>; Fri, 29 Sep 2017 11:05:49 +0100 (BST) From: Andrzej Hajda To: Inki Dae Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, Tobias Jakobi , Daniel Drake Subject: [PATCH v2 09/11] drm/exynos/hdmi: quirk for support mode timings conversion Date: Fri, 29 Sep 2017 12:05:40 +0200 Message-id: <20170929100542.12849-10-a.hajda@samsung.com> X-Mailer: git-send-email 2.14.1 In-reply-to: <20170929100542.12849-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMIsWRmVeSWpSXmKPExsWy7djPc7r/pM5FGnxdwW1xa905VouNM9az Wjya/5jZ4srX92wWk+5PYLGYcX4fk8XaI3fZLdpWf2B14PBY9D3L4373cSaPf8fYPfq2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ioSnyYeQ4ozsHBK2Apse4i1DZ5iXMPboPN5AQKL578hQnEFhKw kFi0cD3rBEbeBYwMqxhFUkuLc9Nzi430ihNzi0vz0vWS83M3MQJDa9uxn1t2MHa9Cz7EKMDB qMTDe0PubKQQa2JZcWXuIUYJDmYlEd4nnOcihXhTEiurUovy44tKc1KLDzFKc7AoifP27lkd KSSQnliSmp2aWpBaBJNl4uCUamDccy9mr+ll7suORT4xytFcDzNePpz5qSZAanbdQq1tavoz nj9i89847/INscI+BQbfSTk7L7lJl06YmpsutVq56uPdG+uu9p6f+OC9wOpfK3ICvTvm5R1d VB97oO547FTmlZeCW4+e0z9lpbX/tIJmtYjRmhW3WHftO5OyvfL3rvbEzXP+54kJK7EUZyQa ajEXFScCAEZK5xwpAgAA X-CMS-MailID: 20170929100549eucas1p2053fdf47957c11fa39d0e026267f088c X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRvsgrw=?= =?UTF-8?B?7ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRtTYW1z?= =?UTF-8?B?dW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-CMS-RootMailID: 20170929100549eucas1p2053fdf47957c11fa39d0e026267f088c X-RootMTR: 20170929100549eucas1p2053fdf47957c11fa39d0e026267f088c References: <20170929100542.12849-1-a.hajda@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 MIXER in SoCs prior to Exynos5420 supports only 4 video modes: 720x480, 720x576, 1280x720, 1920x1080. Support for other modes can be enabled by manipulating timings of HDMI. To do it adjusted_mode should contain actual mode set on crtc. With this patch it is possible to enable 1024x768 and 1280x1024 modes in MIXER. Suggested-by: Daniel Drake Signed-off-by: Andrzej Hajda Reviewed-by: Tobias Jakobi --- drivers/gpu/drm/exynos/exynos_hdmi.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 7225b6521148..4b081f6cfdcb 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -1239,6 +1239,17 @@ static void hdmi_v13_mode_apply(struct hdmi_context *hdata) static void hdmi_v14_mode_apply(struct hdmi_context *hdata) { struct drm_display_mode *m = &hdata->encoder.crtc->state->mode; + struct drm_display_mode *am = &hdata->encoder.crtc->state->adjusted_mode; + int hquirk = 0; + + /* + * In case video mode coming from CRTC differs from requested one HDMI + * sometimes is able to almost properly perform conversion - only + * first line is distorted. + */ + if ((m->vdisplay != am->vdisplay) && + (m->hdisplay == 1280 || m->hdisplay == 1024)) + hquirk = 258; hdmi_reg_writev(hdata, HDMI_H_BLANK_0, 2, m->htotal - m->hdisplay); hdmi_reg_writev(hdata, HDMI_V_LINE_0, 2, m->vtotal); @@ -1332,8 +1343,8 @@ static void hdmi_v14_mode_apply(struct hdmi_context *hdata) hdmi_reg_writev(hdata, HDMI_V_SYNC_LINE_AFT_PXL_6_0, 2, 0xffff); hdmi_reg_writev(hdata, HDMI_TG_H_FSZ_L, 2, m->htotal); - hdmi_reg_writev(hdata, HDMI_TG_HACT_ST_L, 2, m->htotal - m->hdisplay); - hdmi_reg_writev(hdata, HDMI_TG_HACT_SZ_L, 2, m->hdisplay); + hdmi_reg_writev(hdata, HDMI_TG_HACT_ST_L, 2, m->htotal - m->hdisplay - hquirk); + hdmi_reg_writev(hdata, HDMI_TG_HACT_SZ_L, 2, m->hdisplay + hquirk); hdmi_reg_writev(hdata, HDMI_TG_V_FSZ_L, 2, m->vtotal); if (hdata->drv_data == &exynos5433_hdmi_driver_data) hdmi_reg_writeb(hdata, HDMI_TG_DECON_EN, 1);