From patchwork Fri Jan 13 09:20:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 9514913 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 627556077E for ; Fri, 13 Jan 2017 09:32:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52519285E8 for ; Fri, 13 Jan 2017 09:32:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44F3328658; Fri, 13 Jan 2017 09:32:14 +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 549A4285E8 for ; Fri, 13 Jan 2017 09:32:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751303AbdAMJcM (ORCPT ); Fri, 13 Jan 2017 04:32:12 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:9641 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751311AbdAMJcI (ORCPT ); Fri, 13 Jan 2017 04:32:08 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJP005ENON42T60@mailout1.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Fri, 13 Jan 2017 09:21:04 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170113092103eucas1p167786f6679f2b0ed609e0aff801aac85~ZSlDaNRPE0802908029eucas1p1T; Fri, 13 Jan 2017 09:21:03 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3.samsung.com (EUCPMTA) with SMTP id 0C.EC.09557.EFB98785; Fri, 13 Jan 2017 09:21:03 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170113092102eucas1p2e9cc739f2ff96b5ad760f5e5c821037d~ZSlCmoETh2280522805eucas1p2u; Fri, 13 Jan 2017 09:21:02 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-e2-58789bfe68a4 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D3.6D.10233.7FB98785; Fri, 13 Jan 2017 09:20:55 +0000 (GMT) Received: from AMDC2768.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 <0OJP00EESON1HS70@eusync1.samsung.com>; Fri, 13 Jan 2017 09:21:02 +0000 (GMT) From: Andrzej Hajda To: Inki Dae , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, Joonyoung Shim Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: [PATCH v3] drm/exynos/decon5433: set STANDALONE_UPDATE_F also if planes are disabled Date: Fri, 13 Jan 2017 10:20:58 +0100 Message-id: <1484299258-2371-1-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPIsWRmVeSWpSXmKPExsWy7djP87r/Z1dEGPS9Z7S4te4cq8XGGetZ La58fc9mMen+BBaLF/cusljMOL+PyWLtkbvsDuwe97uPM3n0bVnF6PF5k1wAcxSX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2Jv5tvglWJCExmlDj5ZToTiMMs0Mco0fh3FRtIlbBAvMT3Va3MIDaLgKrEoc/n weK8Ak4Sn77/YIXYJydx81wnUA0HB6eAvcS5nkKQsJCAncTFllOMExh5FzAyrGIUSS0tzk3P LTbSK07MLS7NS9dLzs/dxAgM3G3Hfm7Zwdj1LvgQowAHoxIP74Tb5RFCrIllxZW5hxglOJiV RHgtZlVECPGmJFZWpRblxxeV5qQWH2I0BbppIrOUaHI+MKrySuINTQzNLQ2NjC0szI2MlMR5 p364Ei4kkJ5YkpqdmlqQWgTTx8TBKdXAqPh/zWIPk2U1uUWRgkLnHkWxbwlWOrjR7ckc56Y3 QaZxi3ds6fqUK35tPVfLsWv8Qdm/vOpWPue08Ho2ees2832WU6fP0yi7/rn596krj//940i5 xZdVHtM1KUHmCWNf0M5dXyza51tEbTZ2Lw4Ji++rXHOh5XEOy6/vXd9OyjxLuMBtdOJSnBJL cUaioRZzUXEiAKhZen9yAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170113092102eucas1p2e9cc739f2ff96b5ad760f5e5c821037d 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: 20170113092102eucas1p2e9cc739f2ff96b5ad760f5e5c821037d X-RootMTR: 20170113092102eucas1p2e9cc739f2ff96b5ad760f5e5c821037d References: 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 STANDALONE_UPDATE_F should be set if something changed in plane configurations, including plane disable. The patch fixes page-faults bugs, caused by decon still using framebuffers of disabled planes. Signed-off-by: Andrzej Hajda Tested-by: Joonyoung Shim --- v2: fixed clear-bit code (Thx Marek) v3: use test_and_clear_bit (Thx Joonyoung) --- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index ef7fcb5..09e8cc3 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c @@ -46,7 +46,8 @@ enum decon_flag_bits { BIT_CLKS_ENABLED, BIT_IRQS_ENABLED, BIT_WIN_UPDATED, - BIT_SUSPENDED + BIT_SUSPENDED, + BIT_REQUEST_UPDATE }; struct decon_context { @@ -313,6 +314,7 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, /* window enable */ decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, ~0); + set_bit(BIT_REQUEST_UPDATE, &ctx->flags); } static void decon_disable_plane(struct exynos_drm_crtc *crtc, @@ -325,6 +327,7 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc, return; decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, 0); + set_bit(BIT_REQUEST_UPDATE, &ctx->flags); } static void decon_atomic_flush(struct exynos_drm_crtc *crtc) @@ -338,8 +341,7 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc) for (i = ctx->first_win; i < WINDOWS_NR; i++) decon_shadow_protect_win(ctx, i, false); - /* update iff there are active windows */ - if (crtc->base.state->plane_mask) + if (test_and_clear_bit(BIT_REQUEST_UPDATE, &ctx->flags)) decon_set_bits(ctx, DECON_UPDATE, STANDALONE_UPDATE_F, ~0); if (ctx->out_type & IFTYPE_I80)