From patchwork Wed Sep 6 10:36:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 9940311 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 3DD2960224 for ; Wed, 6 Sep 2017 10:37:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 446E41FF27 for ; Wed, 6 Sep 2017 10:37:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3960B28B8E; Wed, 6 Sep 2017 10:37:41 +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 DBD1B1FF27 for ; Wed, 6 Sep 2017 10:37:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753084AbdIFKhk (ORCPT ); Wed, 6 Sep 2017 06:37:40 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:35951 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753085AbdIFKhe (ORCPT ); Wed, 6 Sep 2017 06:37:34 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20170906103731euoutp01eb4d1379a5383c9b9433bf39f7e33121~hv3MwjPxi1660616606euoutp01h; Wed, 6 Sep 2017 10:37:31 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170906103731eucas1p1a69c50f1a42868b6ba05d86d0a2c01a1~hv3MTEZpR0372303723eucas1p1n; Wed, 6 Sep 2017 10:37:31 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 8D.44.12907.BEFCFA95; Wed, 6 Sep 2017 11:37:31 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170906103730eucas1p182c799cf23b889626dde869bbad3250c~hv3LohyuI2586725867eucas1p1q; Wed, 6 Sep 2017 10:37:30 +0000 (GMT) X-AuditID: cbfec7f1-f793a6d00000326b-e6-59afcfeb2239 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 56.FA.20118.AEFCFA95; Wed, 6 Sep 2017 11:37:30 +0100 (BST) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OVU00L0NTIFI200@eusync1.samsung.com>; Wed, 06 Sep 2017 11:37:30 +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 07/10] drm/exynos: add mode_fixup callback to exynos_drm_crtc_ops Date: Wed, 06 Sep 2017 12:36:57 +0200 Message-id: <1504694220-15818-8-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1504694220-15818-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrIIsWRmVeSWpSXmKPExsWy7djP87qvz6+PNGheyGdxa905VouNM9az Wjya/5jZ4srX92wWk+5PYLGYcX4fk8XaI3fZLdpWf2B14PB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rBytiFljFJDGr rRcsISwQLHG6dRvYWBYBVYlNHzYwgti8As4Sb9acYYFYJydx81wnM4jNKeAicer6J7AFQkA1 Mx8uYpzAyLuAkWEVo0hqaXFuem6xkV5xYm5xaV66XnJ+7iZGYHBtO/Zzyw7GrnfBhxgFOBiV eHgtN6yLFGJNLCuuzD3EKMHBrCTC+/fc+kgh3pTEyqrUovz4otKc1OJDjNIcLErivL17VkcK CaQnlqRmp6YWpBbBZJk4OKUaGLfJW7MXpM3wzYu9KRehwvH8x9OwL3v8szx8/F5dLJ4VvcRG JviZ3PtA1d35X85xFfxZvnTefAm2nmWGH2XmzAw3vbcxQtB8VoHRsxrHLR0zlG/o9yqWmyn4 Ba+Y6lmjYuDhufL63VMm/eeU9l8oEzzIcP7Pw8uBHieWPni3YmniTvttfett9yuxFGckGmox FxUnAgBEQCpHKgIAAA== X-CMS-MailID: 20170906103730eucas1p182c799cf23b889626dde869bbad3250c 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: 20170906103730eucas1p182c799cf23b889626dde869bbad3250c X-RootMTR: 20170906103730eucas1p182c799cf23b889626dde869bbad3250c References: <1504694220-15818-1-git-send-email-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 crtc::mode_fixup callback is required by crtcs which use internally different mode than requested by user - case of Exynos Mixer. Signed-off-by: Andrzej Hajda Reviewed-by: Tobias Jakobi --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 15 +++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_drv.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 6ce0821..dc01342 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -95,8 +95,23 @@ static enum drm_mode_status exynos_crtc_mode_valid(struct drm_crtc *crtc, return MODE_OK; } +static bool exynos_crtc_mode_fixup(struct drm_crtc *crtc, + const struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode) +{ + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); + + if (exynos_crtc->ops->mode_fixup) + return exynos_crtc->ops->mode_fixup(exynos_crtc, mode, + adjusted_mode); + + return true; +} + + static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { .mode_valid = exynos_crtc_mode_valid, + .mode_fixup = exynos_crtc_mode_fixup, .atomic_check = exynos_crtc_atomic_check, .atomic_begin = exynos_crtc_atomic_begin, .atomic_flush = exynos_crtc_atomic_flush, diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index cf131c2..e8bcc72 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -136,6 +136,9 @@ struct exynos_drm_crtc_ops { u32 (*get_vblank_counter)(struct exynos_drm_crtc *crtc); enum drm_mode_status (*mode_valid)(struct exynos_drm_crtc *crtc, const struct drm_display_mode *mode); + bool (*mode_fixup)(struct exynos_drm_crtc *crtc, + const struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode); int (*atomic_check)(struct exynos_drm_crtc *crtc, struct drm_crtc_state *state); void (*atomic_begin)(struct exynos_drm_crtc *crtc);