From patchwork Wed Mar 15 14:41:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 9625847 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 D4B0560522 for ; Wed, 15 Mar 2017 14:44:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C898028624 for ; Wed, 15 Mar 2017 14:44:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD9B128637; Wed, 15 Mar 2017 14:44:43 +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 58D622863D for ; Wed, 15 Mar 2017 14:44:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753991AbdCOOmQ (ORCPT ); Wed, 15 Mar 2017 10:42:16 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:65240 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753980AbdCOOlV (ORCPT ); Wed, 15 Mar 2017 10:41:21 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OMV00HV724V2250@mailout2.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Wed, 15 Mar 2017 14:41:19 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170315144118eucas1p28b3229ae7963115deb5ab785f1f2c34a~sFTFP8Ce31304213042eucas1p2X; Wed, 15 Mar 2017 14:41:18 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id FC.FC.16908.09259C85; Wed, 15 Mar 2017 14:41:20 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170315144117eucas1p149df64bb88d3b955440bb6069ada2606~sFTEpAGK30151101511eucas1p1P; Wed, 15 Mar 2017 14:41:17 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-3a-58c95290040f Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D5.63.10233.A9259C85; Wed, 15 Mar 2017 14:41:30 +0000 (GMT) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OMV00GPG24OBF60@eusync2.samsung.com>; Wed, 15 Mar 2017 14:41:17 +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 , Javier Martinez Canillas Subject: [PATCH v3 10/10] drm/exynos/decon5433: simplify shadow protect code Date: Wed, 15 Mar 2017 15:41:10 +0100 Message-id: <1489588870-7785-11-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1489588870-7785-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPIsWRmVeSWpSXmKPExsWy7djP87oTgk5GGNzfbGBxa905VouNM9az Wlz5+p7NYtL9CSwWb96uYbI4f34Du8WM8/uYLNYe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iYSWz/uZ4KwxSQu3FvP1sXI xSEksIRR4nTDARYIp5FJ4v6LecwgVWwCmhJ/N99kA7FFBJQlVu1rZwcpYhbYwCRxt+8kK0hC WMBHYuvJy+wgNouAqsS5B1sZuxg5OHgFnCWe9JVAbJOTuHmuE2wmJ1B4/bnZYFcICThJvGo+ zDSBkXcBI8MqRpHU0uLc9NxiI73ixNzi0rx0veT83E2MwLDeduznlh2MXe+CDzEKcDAq8fBO 8D0ZIcSaWFZcmXuIUYKDWUmEd18gUIg3JbGyKrUoP76oNCe1+BCjKdBNE5mlRJPzgTGXVxJv aGJobmloZGxhYW5kpCTOO/XDlXAhgfTEktTs1NSC1CKYPiYOTqkGxr5owZX6y7O7WaZXHl1c tOCERlrRugb+9uTYEokv2+YervMvnnfnXGY5Qzkbn6vy15Mvm5XmcMV7JmzcG1f5egqrS/nS PeZiK9PeRVe/njS3184i+OqPC9w/vh5WZ83XtD4Rvzp9dkLzrJ93wy6fm2L6TcHCXOOa3OlZ G+RZb2dKRNccL/wjpcRSnJFoqMVcVJwIALLyaK6BAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170315144117eucas1p149df64bb88d3b955440bb6069ada2606 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-HopCount: 7 X-CMS-RootMailID: 20170315144117eucas1p149df64bb88d3b955440bb6069ada2606 X-RootMTR: 20170315144117eucas1p149df64bb88d3b955440bb6069ada2606 References: <1489588870-7785-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 There is no point in protecting only particular windows during update. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 20 +++++++------------- include/video/exynos5433_decon.h | 1 + 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index a68f0cc..03c6a5c 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c @@ -313,23 +313,20 @@ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win, writel(val, ctx->addr + DECON_WINCONx(win)); } -static void decon_shadow_protect_win(struct decon_context *ctx, int win, - bool protect) +static void decon_shadow_protect(struct decon_context *ctx, bool protect) { - decon_set_bits(ctx, DECON_SHADOWCON, SHADOWCON_Wx_PROTECT(win), + decon_set_bits(ctx, DECON_SHADOWCON, SHADOWCON_PROTECT_MASK, protect ? ~0 : 0); } static void decon_atomic_begin(struct exynos_drm_crtc *crtc) { struct decon_context *ctx = crtc->ctx; - int i; if (test_bit(BIT_SUSPENDED, &ctx->flags)) return; - for (i = ctx->first_win; i < WINDOWS_NR; i++) - decon_shadow_protect_win(ctx, i, true); + decon_shadow_protect(ctx, true); } #define BIT_VAL(x, e, s) (((x) & ((1 << ((e) - (s) + 1)) - 1)) << (s)) @@ -412,15 +409,13 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc) { struct decon_context *ctx = crtc->ctx; unsigned long flags; - int i; if (test_bit(BIT_SUSPENDED, &ctx->flags)) return; spin_lock_irqsave(&ctx->vblank_lock, flags); - for (i = ctx->first_win; i < WINDOWS_NR; i++) - decon_shadow_protect_win(ctx, i, false); + decon_shadow_protect(ctx, false); decon_set_bits(ctx, DECON_UPDATE, STANDALONE_UPDATE_F, ~0); @@ -540,11 +535,10 @@ static void decon_clear_channels(struct exynos_drm_crtc *crtc) goto err; } - for (win = 0; win < WINDOWS_NR; win++) { - decon_shadow_protect_win(ctx, win, true); + decon_shadow_protect(ctx, true); + for (win = 0; win < WINDOWS_NR; win++) decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, 0); - decon_shadow_protect_win(ctx, win, false); - } + decon_shadow_protect(ctx, false); decon_set_bits(ctx, DECON_UPDATE, STANDALONE_UPDATE_F, ~0); diff --git a/include/video/exynos5433_decon.h b/include/video/exynos5433_decon.h index 6b083d3..78957c9 100644 --- a/include/video/exynos5433_decon.h +++ b/include/video/exynos5433_decon.h @@ -118,6 +118,7 @@ #define WINCONx_ENWIN_F (1 << 0) /* SHADOWCON */ +#define SHADOWCON_PROTECT_MASK GENMASK(14, 10) #define SHADOWCON_Wx_PROTECT(n) (1 << (10 + (n))) /* VIDOSDxD */