From patchwork Thu Aug 24 13:33:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 9920033 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 460B5603FA for ; Thu, 24 Aug 2017 13:34:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3ED00283E7 for ; Thu, 24 Aug 2017 13:34:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33B882847D; Thu, 24 Aug 2017 13:34:23 +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 CB2BE28557 for ; Thu, 24 Aug 2017 13:34:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752978AbdHXNeS (ORCPT ); Thu, 24 Aug 2017 09:34:18 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:60406 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752815AbdHXNeO (ORCPT ); Thu, 24 Aug 2017 09:34:14 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20170824133412euoutp020daff645177c4eca2cbe9110487c93ef~dy4wILRmO1130911309euoutp025; Thu, 24 Aug 2017 13:34:12 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170824133411eucas1p113a40cb301e3bd1c3af7d93fa12ded6f~dy4vQRXGy2921429214eucas1p1T; Thu, 24 Aug 2017 13:34:11 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id E5.C8.12944.3D5DE995; Thu, 24 Aug 2017 14:34:11 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170824133411eucas1p2cedf32dfa953896267b2db58f1af30b7~dy4ugn4n51016910169eucas1p21; Thu, 24 Aug 2017 13:34:11 +0000 (GMT) X-AuditID: cbfec7f4-f79ab6d000003290-f1-599ed5d32321 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 3A.4C.20118.3D5DE995; Thu, 24 Aug 2017 14:34:11 +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 <0OV60031EZ0V8CD0@eusync4.samsung.com>; Thu, 24 Aug 2017 14:34:11 +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, devicetree@vger.kernel.org, Krzysztof Kozlowski Subject: [PATCH v2 07/10] drm/exynos: add mode_valid callback to exynos_drm Date: Thu, 24 Aug 2017 15:33:56 +0200 Message-id: <1503581639-580-8-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1503581639-580-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFIsWRmVeSWpSXmKPExsWy7djP87qXr86LNJg1Xdvi1rpzrBYbZ6xn tZh/BMi68vU9m8Wk+xNYLM6f38BuMeP8PiaLtUfusjtweGxa1c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gCaPE 7eVSXYxcQHYjk8StU5OYQBJsApoSfzffBCsSEVCWWLWvnR3EZhaYySTRvIcDxBYW8JbYvPcJ WJxFQFXix7LlYDavgKPElIstLBDL5CRunutkBrE5BZwkDu5ZAbXYUeLq630sExh5FzAyrGIU SS0tzk3PLTbSK07MLS7NS9dLzs/dxAgM5G3Hfm7Zwdj1LvgQowAHoxIP740r8yKFWBPLiitz DzFKcDArifDu2ggU4k1JrKxKLcqPLyrNSS0+xGgKdNREZinR5HxglOWVxBuaGJpbGhoZW1iY GxkpifOqX26KFBJITyxJzU5NLUgtgulj4uCUamC83t4o+tT+0Hth08kvj89sEb/vqnH5/cHr G5NnFbw8ufWVPGOKe/Dn/WdNDnay/X7TuIhpEee03+eLDIS7ProUrKn6YLI9QvL0ojM70uKj 3tf0vTiyeR7PNInHp+ZYcTGsn+uY6GYgfuf3kf+cPPYnEr93ampvuD/V6Y7XV6H3LL6WlaeZ rs2pU2Ipzkg01GIuKk4EAEO/hWx6AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170824133411eucas1p2cedf32dfa953896267b2db58f1af30b7 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: 20170824133411eucas1p2cedf32dfa953896267b2db58f1af30b7 X-RootMTR: 20170824133411eucas1p2cedf32dfa953896267b2db58f1af30b7 References: <1503581639-580-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_valid callback is required to implement proper pipeline validation for command/video modes. Since Exynos uses private framework such callback should be added to it. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 12 ++++++++++++ drivers/gpu/drm/exynos/exynos_drm_drv.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index ac544de..6ce0821 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -84,7 +84,19 @@ static void exynos_crtc_atomic_flush(struct drm_crtc *crtc, exynos_crtc->ops->atomic_flush(exynos_crtc); } +static enum drm_mode_status exynos_crtc_mode_valid(struct drm_crtc *crtc, + const struct drm_display_mode *mode) +{ + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); + + if (exynos_crtc->ops->mode_valid) + return exynos_crtc->ops->mode_valid(exynos_crtc, mode); + + return MODE_OK; +} + static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { + .mode_valid = exynos_crtc_mode_valid, .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 9e77809..d53435b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -117,6 +117,7 @@ struct exynos_drm_plane_config { * @disable: disable the device * @enable_vblank: specific driver callback for enabling vblank interrupt. * @disable_vblank: specific driver callback for disabling vblank interrupt. + * @mode_valid: specific driver callback for mode validation * @atomic_check: validate state * @atomic_begin: prepare device to receive an update * @atomic_flush: mark the end of device update @@ -132,6 +133,8 @@ struct exynos_drm_crtc_ops { int (*enable_vblank)(struct exynos_drm_crtc *crtc); void (*disable_vblank)(struct exynos_drm_crtc *crtc); 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); int (*atomic_check)(struct exynos_drm_crtc *crtc, struct drm_crtc_state *state); void (*atomic_begin)(struct exynos_drm_crtc *crtc);