From patchwork Wed Mar 20 13:06:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10861571 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 A91BE17EF for ; Wed, 20 Mar 2019 13:07:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DA862838B for ; Wed, 20 Mar 2019 13:07:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C28529077; Wed, 20 Mar 2019 13:07:19 +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 621D028B63 for ; Wed, 20 Mar 2019 13:07:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727141AbfCTNHQ (ORCPT ); Wed, 20 Mar 2019 09:07:16 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55149 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727359AbfCTNHP (ORCPT ); Wed, 20 Mar 2019 09:07:15 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190320130714euoutp014f3df7d756bd5ac087d3ad1adebdcfbe~NrJyAW8wt0183101831euoutp01r; Wed, 20 Mar 2019 13:07:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190320130714euoutp014f3df7d756bd5ac087d3ad1adebdcfbe~NrJyAW8wt0183101831euoutp01r DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1553087234; bh=yzRSaJjb04WXw7ci4RcnQ2/nqT/0CwcF9Ug5GhkIUA4=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=oiALp3Xlv2OcK0NRONHMHfqIJxjdTRTmSsTtm4EXJUlfFjaABMcMensf8S77CNyZm 4FIQrJp9fL96VKxi5iazbOJ1Qywnvaw1eciAz0L7vd8uMRy811yFmR/mezZy7fqvJB pP/AXGHWPjz0X/YESpTSLK1cPAhBX/7LkpxZlGWw= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190320130714eucas1p2f0138d261aac8abf3d24c0d93afa5b31~NrJxnmcGd1038110381eucas1p2w; Wed, 20 Mar 2019 13:07:14 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 88.92.04806.20B329C5; Wed, 20 Mar 2019 13:07:14 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190320130713eucas1p2dd57732ea0135355863ba26424a8bacf~NrJxDaQqc1479814798eucas1p2M; Wed, 20 Mar 2019 13:07:13 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-1c-5c923b02e228 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 13.AF.04284.10B329C5; Wed, 20 Mar 2019 13:07:13 +0000 (GMT) Received: from AMDC3748.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 <0POO004P71RZN460@eusync1.samsung.com>; Wed, 20 Mar 2019 13:07:13 +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 v2 RESEND 04/24] drm/exynos: add exynos_drm_crtc_init function Date: Wed, 20 Mar 2019 14:06:47 +0100 Message-id: <20190320130707.25161-5-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20190320130707.25161-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGIsWRmVeSWpSXmKPExsWy7djP87pM1pNiDDraWCxurTvHarFxxnpW iytf37NZTLo/gcXi/PkN7BYzzu9jslh75C67A7vHplWdbB73u48zefRtWcXo8XmTXABLFJdN SmpOZllqkb5dAldG162fjAUP+Su6751naWA8yNvFyM4hIWAicZ61i5GLQ0hgBaPEjzNngBxO IOczo8Tc3pwuRg6wkoWnVCBqljFK3G2eBNXwn1GiZ+85RpAGNgFNib+bb7KB2CICyhKr9rWz gxQxC/xmlJi+fBs7SEJYIEDiaVcDWAOLgKrErZknwLbxClhIXPxzCCwuISAvsXrDAWYQm1PA UuLhnP9ggyQEGtkk9k66zwZR5CKxZf8CdghbRqKz4yAThF0vcX9FCzNEQwejxNYNO5khEtYS h49fBNvGLMAnMWnbdGaI33glOtqEIEo8JDadfckI8VoPo0Tvm4WsExglFjAyrGIUTy0tzk1P LTbOSy3XK07MLS7NS9dLzs/dxAiMrdP/jn/dwbjvT9IhRgEORiUe3gvPJ8QIsSaWFVfmHmKU 4GBWEuGNUJoUI8SbklhZlVqUH19UmpNafIhRmoNFSZy3muFBtJBAemJJanZqakFqEUyWiYNT qoExx189aXMUw0+u3sfHTZSvTVjRGjJp9i/WPQt9/nMqO9iabmBaq2hfPG3liQ33Yn6vzl1v LriST2Tz14lXFnMq5CjPc9l0WCUkpnyn0Gyv047xHg1Z33Q6Fpka3bruese6b56WT4aLYcS2 Rsb2G/Kt7OweJgd4th5i2s733Gib83qrTa/XbFiuxFKckWioxVxUnAgAAMOznakCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42I5/e/4ZV1G60kxBu17lSxurTvHarFxxnpW iytf37NZTLo/gcXi/PkN7BYzzu9jslh75C67A7vHplWdbB73u48zefRtWcXo8XmTXABLFJdN SmpOZllqkb5dAldG162fjAUP+Su6751naWA8yNvFyMEhIWAisfCUShcjF4eQwBJGiZ9Lb7NB OI1MEucv3WHqYuTkYBPQlPi7+SYbiC0ioCyxal87O0gRs8BvRonPM74ygySEBfwkFlyfxAhi swioStyaeYIVxOYVsJC4+OcQWFxCQF5i9YYDYPWcApYSD+f8ZwexhYBqFp+4yziBkWcBI8Mq RpHU0uLc9NxiQ73ixNzi0rx0veT83E2MwJDZduzn5h2MlzYGH2IU4GBU4uGteDohRog1say4 MvcQowQHs5IIb4TSpBgh3pTEyqrUovz4otKc1OJDjNIcLErivOcNKqOEBNITS1KzU1MLUotg skwcnFINjLzl503CBcQzHV3+54VV2mbJTb/Cc0pc1tS690fCW3nhX1+jNgSv7A3/+SB99b6j 6y/LLF/1wX2yV9H6B8e5rA/fl7xs261b+1zXXLHzg8kt71SmdevTD93j2xkUZcF3unXx0x2c LmfmLpmcv+zey2mzL3CffTOhKFtQsW89r2ST/pFub0Gby0osxRmJhlrMRcWJAEmmZVwVAgAA X-CMS-MailID: 20190320130713eucas1p2dd57732ea0135355863ba26424a8bacf CMS-TYPE: 201P X-CMS-RootMailID: 20190320130713eucas1p2dd57732ea0135355863ba26424a8bacf References: <20190320130707.25161-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,