From patchwork Fri Dec 7 10:01:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10717797 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 3AA0013AF for ; Fri, 7 Dec 2018 10:02:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AB7E2E151 for ; Fri, 7 Dec 2018 10:02:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E8642E530; Fri, 7 Dec 2018 10:02:04 +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 0971E2E151 for ; Fri, 7 Dec 2018 10:02:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726019AbeLGKCC (ORCPT ); Fri, 7 Dec 2018 05:02:02 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:38902 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbeLGKCB (ORCPT ); Fri, 7 Dec 2018 05:02:01 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181207100158euoutp0183267180263da3f71500f302a60552f0~uBLnyekBh0704707047euoutp01b; Fri, 7 Dec 2018 10:01:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181207100158euoutp0183267180263da3f71500f302a60552f0~uBLnyekBh0704707047euoutp01b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1544176918; bh=v4/A+YDFk05Q/Oi8KgB9+oXeLa4gCk51G4MXB0nOm0w=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=jJAvXAbfdfzv0BDQTGAu5319MsWI7mgeSzvpPqxB0vjzijDlJOtrf4grL50tOT0zD K++IYLdBl8yy+kP8bMW14q6fFZ0svXQWjtWEtI4bOuWFAwwXehX3Mg1ToUZTlXEuuT rdjO09lMrHaq/KuuubtSW5ZhKOT+BNOJQsPV6u+k= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181207100158eucas1p21464fb1a09ffe6a89aa8dcd55f98a903~uBLnRDU-g2782327823eucas1p2C; Fri, 7 Dec 2018 10:01:58 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 80.19.04441.6154A0C5; Fri, 7 Dec 2018 10:01:58 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181207100157eucas1p2a7ab15738d7d436ced74cc487dc24c21~uBLmmCqCN2771227712eucas1p2q; Fri, 7 Dec 2018 10:01:57 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-1c-5c0a4516d49b Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 2C.09.04128.5154A0C5; Fri, 7 Dec 2018 10:01:57 +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 <0PJD006FP2J86Y70@eusync1.samsung.com>; Fri, 07 Dec 2018 10:01:57 +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 REBASED 2/3] drm/exynos/fimd: create local helper for disabling hardware window Date: Fri, 07 Dec 2018 11:01:51 +0100 Message-id: <20181207100152.30028-3-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181207100152.30028-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJIsWRmVeSWpSXmKPExsWy7djP87pirlwxBq9+slrcWneO1WLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnL7sDmcb/7OJNH35ZVjB6fN8kFMEdx2aSk5mSWpRbp2yVw Zey7PI+xYJNgRc/uC2wNjFv5uhg5OSQETCReLLrA1sXIxSEksIJR4tuliewgCSGBz4wSz+/Z wBS9n3GJGaJoGaPEs08vWCGc/4wSJ248YAWpYhPQlPi7+SYbiC0ioCyxal87O0gRs8AlRonX J7sZuxg5OIQFEiU6HrqD1LAIqEqsPHCfBcTmFbCQ+DLzJQvENnmJ1RsOMIPYnAKWEtvXXwU7 T0LgLavEorb1TCBzJARcJC4/SYeoF5Z4dXwLO4QtI3F5cjfUnHqJpplXmCF6O4AOXbycDSJh LXH4+EWwo5kF+CQmbZvODDGTV6KjTQiixEPi4rEJ0GDpYZT49OcE2wRGyQWMDKsYxVNLi3PT U4sN81LL9YoTc4tL89L1kvNzNzECI+z0v+OfdjB+vZR0iFGAg1GJh7fCgTNGiDWxrLgy9xCj BAezkgivki1XjBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHeaoYH0UIC6YklqdmpqQWpRTBZJg5O qQbGfUVXX9s4RPgWR5bJOq8/ul7yZORbA79olgmeuxd4Fy3ebbZVdocEw9otVquPCjentMTY rNNZzSgsy2gknvzQJ6v1VnryO03RRUdcU35snKjWvvg307wnn3+lvly0ZvXydT8yY44wXrRj +iD5dGbgnyuCq45y+p85tPrQfvXHSVt+JjGa6fZGK7EUZyQaajEXFScCANl8d8WsAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBJMWRmVeSWpSXmKPExsVy+t/xy7qirlwxBgtWK1vcWneO1WLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnL7sDmcb/7OJNH35ZVjB6fN8kFMEdx2aSk5mSWpRbp2yVw Zey7PI+xYJNgRc/uC2wNjFv5uhg5OSQETCTez7jEDGILCSxhlPjw07+LkQvIbmSS6H55lAUk wSagKfF38002EFtEQFli1b52dpAiZoErjBLt37rYQRLCAokSu8//BmtgEVCVWHngPpjNK2Ah 8WXmSxaIbfISqzccANvGKWApsX39VTaIzRYSyz9vZpnAyLOAkWEVo0hqaXFuem6xkV5xYm5x aV66XnJ+7iZGYHhsO/Zzyw7GrnfBhxgFOBiVeHgrHDhjhFgTy4orcw8xSnAwK4nwKtlyxQjx piRWVqUW5ccXleakFh9ilOZgURLnPW9QGSUkkJ5YkpqdmlqQWgSTZeLglGpgZPxcxmb5uVV+ +9s5rSusY3PeX1AJVLpx2kzYlX89E9+9hB+dByqYnvmwRE+8cEdsysKYDeq75nW8FZlQqcPO 6Kd6+XJzZM0PjbLFSxOdO7c/vthrvnZBy46cn1c8vpUdfvhwSXtDyd9LmcclVHj+RzbllHJ3 PU1aN2N/1ZLqSttXP+cYhDO8U2Ipzkg01GIuKk4EAI+j+1ALAgAA X-CMS-MailID: 20181207100157eucas1p2a7ab15738d7d436ced74cc487dc24c21 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181207100157eucas1p2a7ab15738d7d436ced74cc487dc24c21 References: <20181207100152.30028-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 Hardware window disabling is performed in multiple places. Creating helper for it simplifies the code and prepares it for further improvements. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 786a8ee6f10f..a7993f5d8371 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -345,6 +345,14 @@ static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, writel(val, ctx->regs + SHADOWCON); } +static void fimd_disable_win(struct fimd_context *ctx, int win) +{ + fimd_enable_video_output(ctx, win, false); + + if (ctx->driver_data->has_shadowcon) + fimd_enable_shadow_channel_path(ctx, win, false); +} + static void fimd_clear_channels(struct exynos_drm_crtc *crtc) { struct fimd_context *ctx = crtc->ctx; @@ -363,12 +371,7 @@ static void fimd_clear_channels(struct exynos_drm_crtc *crtc) u32 val = readl(ctx->regs + WINCON(win)); if (val & WINCONx_ENWIN) { - fimd_enable_video_output(ctx, win, false); - - if (ctx->driver_data->has_shadowcon) - fimd_enable_shadow_channel_path(ctx, win, - false); - + fimd_disable_win(ctx, win); ch_enabled = 1; } } @@ -880,15 +883,11 @@ static void fimd_disable_plane(struct exynos_drm_crtc *crtc, struct exynos_drm_plane *plane) { struct fimd_context *ctx = crtc->ctx; - unsigned int win = plane->index; if (ctx->suspended) return; - fimd_enable_video_output(ctx, win, false); - - if (ctx->driver_data->has_shadowcon) - fimd_enable_shadow_channel_path(ctx, win, false); + fimd_disable_win(ctx, plane->index); } static void fimd_enable(struct exynos_drm_crtc *crtc) @@ -923,7 +922,7 @@ static void fimd_disable(struct exynos_drm_crtc *crtc) * a destroyed buffer later. */ for (i = 0; i < WINDOWS_NR; i++) - fimd_disable_plane(crtc, &ctx->planes[i]); + fimd_disable_win(ctx, i); fimd_enable_vblank(crtc); fimd_wait_for_vblank(crtc);