From patchwork Fri Mar 1 12:20:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10835067 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 2CA641515 for ; Fri, 1 Mar 2019 12:21:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17FF02D964 for ; Fri, 1 Mar 2019 12:21:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B6E62D99B; Fri, 1 Mar 2019 12:21:11 +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 A51C02D8F5 for ; Fri, 1 Mar 2019 12:21:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387710AbfCAMVK (ORCPT ); Fri, 1 Mar 2019 07:21:10 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:36636 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387692AbfCAMVK (ORCPT ); Fri, 1 Mar 2019 07:21:10 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190301122108euoutp014bb96fb19c7d9ac3dd726247e5d39fcf~H1RHCWt5D1452714527euoutp01R; Fri, 1 Mar 2019 12:21:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190301122108euoutp014bb96fb19c7d9ac3dd726247e5d39fcf~H1RHCWt5D1452714527euoutp01R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1551442868; bh=yzRSaJjb04WXw7ci4RcnQ2/nqT/0CwcF9Ug5GhkIUA4=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=F+akyiLv/j3lQ2nPc1y6u+Mpwp49vI3WTn24IP0QHX8DCuRIXNKRm8a+RadM4hTfo CXCtTrtfPtcPzoXj+El4Q0YzfowY1JhfJvy7IjQIHjvpPOXZ+YBCg7Pz31O9xQ+epu ipO3aqTA37M27OgDWY8yq7titwQm+AvGnbMD+iaE= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190301122108eucas1p161274a8681d96707a1eb4a8b3d928729~H1RGpaHzl3036530365eucas1p1P; Fri, 1 Mar 2019 12:21:08 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 00.5B.04806.3B3297C5; Fri, 1 Mar 2019 12:21:08 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190301122107eucas1p2b546a8f156d54c45669bfa9724c4b8c2~H1RF0UkuP1858618586eucas1p2P; Fri, 1 Mar 2019 12:21:07 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-7e-5c7923b3a73e Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B3.6C.04128.3B3297C5; Fri, 1 Mar 2019 12:21:07 +0000 (GMT) Received: from AMDC3748.DIGITAL.local ([106.120.43.17]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PNO007ENSZ56Z20@eusync3.samsung.com>; Fri, 01 Mar 2019 12:21:07 +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 Subject: [PATCH 04/23] drm/exynos: add exynos_drm_crtc_init function Date: Fri, 01 Mar 2019 13:20:36 +0100 Message-id: <20190301122055.7135-5-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20190301122055.7135-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42LZduznOd0typUxBts+MlrcWneO1WLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnL7sDmcb/7OJNH35ZVjB6fN8kFMEdx2aSk5mSWpRbp2yVw ZXTd+slY8JC/ovveeZYGxoO8XYwcHBICJhKHz/F0MXJxCAmsYJToed3BDuF8ZpR4sP8Ucxcj J1jRh1VrGCESyxgl5t1pYIVw/jNKdPZeZwGpYhPQlPi7+SYbiC0ioCyxal872ChmgUuMEq9P djOC7BMWcJG4/9ocpIZFQFXiyZU+FpAwr4C5xIzzvBDL5CVWbzgAtphTwELi4EqIMRICb1kl 3vZdYYQocpFY+vs11HUyEpcnd7NA2PUSTTOvMEM0dDBKnFi8nA0iYS1x+PhFVhCbWYBPYtK2 6cwQ//NKdLQJQZR4SGx+sIYJxBYS6GaU+NOtOoFRYgEjwypG8dTS4tz01GLjvNRyveLE3OLS vHS95PzcTYzAODr97/jXHYz7/iQdYhTgYFTi4d3xujxGiDWxrLgy9xCjBAezkggvH0NljBBv SmJlVWpRfnxRaU5q8SFGaQ4WJXHeaoYH0UIC6YklqdmpqQWpRTBZJg5OqQbGeJmnrz9Y3TqY 87RQM8BsDtO3MpP5bsa3L0yPUPOYa96dcX57496n3SeM+uYc0pkjt+r/t00f2hg1dv+q0XQR Pn/0y/8Q+/zsA8Fex6bssLWvvVmgv15vuoLnu7afGivqUvu6nshf4fibcILhqYTOzTdlHke8 CiKYrq4y0IqLUa9k9J14bvtZJZbijERDLeai4kQA67gKIp8CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGJMWRmVeSWpSXmKPExsVy+t/xq7qblStjDC6vlLO4te4cq8XGGetZ La58fc9mMen+BBaLGef3MVmsPXKX3YHN4373cSaPvi2rGD0+b5ILYI7isklJzcksSy3St0vg yui69ZOx4CF/Rfe98ywNjAd5uxg5OSQETCQ+rFrD2MXIxSEksIRRonfRRFYIp5FJ4tqyrUwg VWwCmhJ/N99kA7FFBJQlVu1rZwcpYha4wijR/q0LyOHgEBZwkbj/2hykhkVAVeLJlT4WkDCv gLnEjPNQy+QlVm84wAxicwpYSBxc2Q7WKQRUsul01ARGngWMDKsYRVJLi3PTc4uN9IoTc4tL 89L1kvNzNzECQ2PbsZ9bdjB2vQs+xCjAwajEw5vwsjxGiDWxrLgy9xCjBAezkggvH0NljBBv SmJlVWpRfnxRaU5q8SFGaQ4WJXHe8waVUUIC6YklqdmpqQWpRTBZJg5OqQZGR4lzW6+eVf5b 8JNLkcvJs0p4eYZSn/m0Uo+g1VG/5l+SYFhst//Det/QeSuZzkhcVb8h0rUxRmzaLo1JLcsa Jzd5zwrqLyrhOSxq1ZaRtlL2evqHuRmbM+e/7E/0vnN0+rNPDs0R6+efZbDUVm5ZZXI9+F1Z CWfh4X/z7yqe4XsdrKPI3CuixFKckWioxVxUnAgAufal6QkCAAA= X-CMS-MailID: 20190301122107eucas1p2b546a8f156d54c45669bfa9724c4b8c2 CMS-TYPE: 201P X-CMS-RootMailID: 20190301122107eucas1p2b546a8f156d54c45669bfa9724c4b8c2 References: <20190301122055.7135-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,