From patchwork Mon Mar 25 07:13:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10868015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A13914DE for ; Mon, 25 Mar 2019 07:13:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3342A29246 for ; Mon, 25 Mar 2019 07:13:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27B4129255; Mon, 25 Mar 2019 07:13: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 C3FDA29246 for ; Mon, 25 Mar 2019 07:13:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729788AbfCYHN6 (ORCPT ); Mon, 25 Mar 2019 03:13:58 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:41920 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729765AbfCYHN6 (ORCPT ); Mon, 25 Mar 2019 03:13:58 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190325071356euoutp01a6a16fe2f2fd4c63ac7774c1ead45aa0~PIjvW7Bcf0750607506euoutp01U; Mon, 25 Mar 2019 07:13:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190325071356euoutp01a6a16fe2f2fd4c63ac7774c1ead45aa0~PIjvW7Bcf0750607506euoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1553498036; bh=yzRSaJjb04WXw7ci4RcnQ2/nqT/0CwcF9Ug5GhkIUA4=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=hrcSw26Mp66Z+ab5+H96HSbZn9FRTDrvSWosHmLP+GSd5u1IPxl+Qy0tPHNudOSd6 /T/D4z2J0srxJ9H9zbYUyVhJouT/I3uGuN3EVAUeGLQqq0/XbTRQWfXqqWXw8N2apf 4yXk+cJaAdShPlXh9ceuKkbScGfhyvMOQXb6m44w= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190325071356eucas1p259078e2afd5a8a55e7aa69ee915ec917~PIju8UFYI0649606496eucas1p2N; Mon, 25 Mar 2019 07:13:56 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id FE.5E.04298.4BF789C5; Mon, 25 Mar 2019 07:13:56 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190325071355eucas1p1cbb56752b2560cb6384d79df9c4124a3~PIjuVBIdk0855608556eucas1p1t; Mon, 25 Mar 2019 07:13:55 +0000 (GMT) X-AuditID: cbfec7f2-f2dff700000010ca-b3-5c987fb47e64 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 7A.19.04140.3BF789C5; Mon, 25 Mar 2019 07:13:55 +0000 (GMT) Received: from AMDC3748.DIGITAL.local ([106.120.51.74]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0POW003QHUR43P00@eusync3.samsung.com>; Mon, 25 Mar 2019 07:13:55 +0000 (GMT) From: Andrzej Hajda To: Inki Dae Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, Krzysztof Kozlowski Subject: [PATCH v3 RESEND 06/24] drm/exynos: add exynos_drm_crtc_init function Date: Mon, 25 Mar 2019 08:13:31 +0100 Message-id: <20190325071349.22600-7-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20190325071349.22600-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJIsWRmVeSWpSXmKPExsWy7djPc7pb6mfEGJxdyWVxa905VouNM9az Wlz5+p7NYtL9CSwW589vYLeYcX4fk8XaI3fZHdg9Nq3qZPO4332cyaNvyypGj8+b5AJYorhs UlJzMstSi/TtErgyum79ZCx4yF/Rfe88SwPjQd4uRk4OCQETiUsffzCC2EICKxglXm8362Lk ArI/M0ocPL+FHa5o+2lWiMQyRol1qz9BOf8ZJS5NvsIMUsUmoCnxd/NNNhBbREBZYtW+dnaQ ImaB34wS05dvAxslLBAg0XDnOVgRi4CqxPLbJ5lAbF4BC4nFMzYxQ6yTl1i94QCYzSlgKfH/ 9CVmkEESAn9ZJTbeXg1V5CKxcsMWRghbRuLy5G4WCLte4v6KFqiGDkaJrRt2QjVYSxw+fpEV xGYW4JOYtG06UJwDKM4r0dEmBFHiIfF8+3cWiNd6GCU+N31hm8AosYCRYRWjeGppcW56arFh Xmq5XnFibnFpXrpecn7uJkZghJ3+d/zTDsavl5IOMQpwMCrx8L7YOT1GiDWxrLgy9xCjBAez kgjvE9EZMUK8KYmVValF+fFFpTmpxYcYpTlYlMR5qxkeRAsJpCeWpGanphakFsFkmTg4pRoY 98ZvT1aasIe/5Y4Q76kd7r5v/QK3CR9Nli/Zrqz/wyz0RcEWh9N8Z5yu+T73PXL6CMOVEOtw c973h/LiI2bGrlKYpBHqc0Tz//oj9claDU9XnPiqu174n14zb5dQGufy5jYRiUJW6QsO66u9 sldMab5WP715996btQq2FS7lD2RErzS+8PisxFKckWioxVxUnAgAVQFQ16wCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42I5/e/4Vd3N9TNiDH4d0bW4te4cq8XGGetZ La58fc9mMen+BBaL8+c3sFvMOL+PyWLtkbvsDuwem1Z1snnc7z7O5NG3ZRWjx+dNcgEsUVw2 Kak5mWWpRfp2CVwZXbd+MhY85K/ovneepYHxIG8XIyeHhICJxKXtp1lBbCGBJYwSXU+AbC4g u5FJYua69YwgCTYBTYm/m2+ygdgiAsoSq/a1s4MUMQv8ZpT4POMrM0hCWMBP4tG+w2BFLAKq Estvn2QCsXkFLCQWz9jEDLFNXmL1hgNgNqeApcT/05eYITZbSOxd1sg+gZFnASPDKkaR1NLi 3PTcYiO94sTc4tK8dL3k/NxNjMCQ2Xbs55YdjF3vgg8xCnAwKvHwOuyZHiPEmlhWXJl7iFGC g1lJhPeJ6IwYId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rznDSqjhATSE0tSs1NTC1KLYLJMHJxS DYxtt54whXx69fzJ6/0mt13akrhr24LW297Y/G/X9klXm0IvXFCQcCr8Uvtqu93WTfobBCKK H80+H/q232xB5YbfX7mvHzvobaR7UNk+axm/MtPcTr0qgWjGg+q1V5/6cVf/rLw395vOxON/ GJZN0jpj/idtybfYuwuaX980Xb58pdJJrnszfI6fUGIpzkg01GIuKk4EADZ7dVIVAgAA X-CMS-MailID: 20190325071355eucas1p1cbb56752b2560cb6384d79df9c4124a3 CMS-TYPE: 201P X-CMS-RootMailID: 20190325071355eucas1p1cbb56752b2560cb6384d79df9c4124a3 References: <20190325071349.22600-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 Since exynos_drm_crtc is a struct which maps 1:1 to underlying device it is better to put it directly into device's context instead of allocating it separately. Another benefit is possibility of initialisation of its fields directly, without expanding exynos_drm_crtc_create which is already overloaded with number of arguments. As a first step of the transition initialisation function should be created. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 10 ++++++++++ drivers/gpu/drm/exynos/exynos_drm_crtc.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 1eebfa3fa8da..4ff1e0ff2255 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -172,6 +172,16 @@ static const struct drm_crtc_funcs exynos_crtc_funcs = { .disable_vblank = exynos_drm_crtc_disable_vblank, }; +int exynos_drm_crtc_init(struct exynos_drm_crtc *exynos_crtc, + struct drm_device *drm_dev) +{ + struct drm_crtc *crtc = &exynos_crtc->base; + + drm_crtc_helper_add(crtc, &exynos_crtc_helper_funcs); + return drm_crtc_init_with_planes(drm_dev, crtc, NULL, NULL, + &exynos_crtc_funcs, NULL); +} + struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, struct drm_plane *plane, enum exynos_drm_output_type type, diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.h b/drivers/gpu/drm/exynos/exynos_drm_crtc.h index dec446109e6c..9e35a9e02332 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.h +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.h @@ -18,6 +18,8 @@ #include "exynos_drm_drv.h" +int exynos_drm_crtc_init(struct exynos_drm_crtc *exynos_crtc, + struct drm_device *drm_dev); struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, struct drm_plane *plane, enum exynos_drm_output_type out_type,