From patchwork Mon Nov 17 13:00:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YoungJun Cho X-Patchwork-Id: 5318771 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 142109F818 for ; Mon, 17 Nov 2014 13:00:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3437A20212 for ; Mon, 17 Nov 2014 13:00:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3DEE420173 for ; Mon, 17 Nov 2014 13:00:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6009C6E08C; Mon, 17 Nov 2014 05:00:24 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A3116E08C for ; Mon, 17 Nov 2014 05:00:22 -0800 (PST) Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NF6003YSPGKH720@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 17 Nov 2014 22:00:20 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.45]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id EE.03.18167.461F9645; Mon, 17 Nov 2014 22:00:20 +0900 (KST) X-AuditID: cbfee690-f79ab6d0000046f7-7d-5469f1643aaa Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 02.52.20081.461F9645; Mon, 17 Nov 2014 22:00:20 +0900 (KST) Received: from localhost.localdomain ([10.252.75.90]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NF60048CPGGHM50@mmp2.samsung.com>; Mon, 17 Nov 2014 22:00:20 +0900 (KST) From: YoungJun Cho To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/9] drm/exynos: fimd: add fimd_enable_shadow_channel_path() to cleanup Date: Mon, 17 Nov 2014 22:00:11 +0900 Message-id: <1416229216-32018-5-git-send-email-yj44.cho@samsung.com> X-Mailer: git-send-email 1.9.0 In-reply-to: <1416229216-32018-1-git-send-email-yj44.cho@samsung.com> References: <1416229216-32018-1-git-send-email-yj44.cho@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrALMWRmVeSWpSXmKPExsVy+t8zXd2Uj5khBrvmmVjcWneO1eLK1/ds FpPuT2CxeHHvIovF2aY37BYzzu9jspgx+SWbA7vH/e7jTB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CVMWOvYUGvRMWlf7fZGxjfCXcxcnJICJhINH+7xwxhi0lcuLeerYuRi0NIYBmjxIH9 nWwwRdeX/WWHSExnlHjR9xyqqpVJ4t37XrAqNgFNiecfd7CC2CICyhJ/J65iBLGZBRYwSly9 wQFiCwtESix//IIFxGYRUJV43nGHqYuRg4NXwEXi+ctQiGVyElN+L2AHsTkFXCXezO4BGyME VLLk20lGkL0SAu3sEpP37maGmCMg8W3yIRaQORICshKbDkB9IylxcMUNlgmMwgsYGVYxiqYW JBcUJ6UXmegVJ+YWl+al6yXn525ihAT0hB2M9w5YH2IU4GBU4uHdkZ0ZIsSaWFZcmXuI0RRo w0RmKdHkfGDc5JXEGxqbGVmYmpgaG5lbmimJ876W+hksJJCeWJKanZpakFoUX1Sak1p8iJGJ g1OqgZH11MNWaxaR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GS X-CFilter-Loop: Reflected Cc: linux-samsung-soc@vger.kernel.org, sw0312.kim@samsung.com, a.hajda@samsung.com, kyungmin.park@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This function is valid only the SoC has SHADOWCON register and it should be used together with fimd_enable_video_output() to match the ENWIN_F bit in WINCON# and C#_EN_F bit in SHADOWCON. Signed-off-by: YoungJun Cho Acked-by: Inki Dae Acked-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 40 ++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 5cfd251..fd7b469 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -242,6 +242,19 @@ static void fimd_enable_video_output(struct fimd_context *ctx, int win, writel(val, ctx->regs + WINCON(win)); } +static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win, + bool enable) +{ + u32 val = readl(ctx->regs + SHADOWCON); + + if (enable) + val |= SHADOWCON_CHx_ENABLE(win); + else + val &= ~SHADOWCON_CHx_ENABLE(win); + + writel(val, ctx->regs + SHADOWCON); +} + static void fimd_clear_channel(struct exynos_drm_manager *mgr) { struct fimd_context *ctx = mgr->ctx; @@ -256,12 +269,10 @@ static void fimd_clear_channel(struct exynos_drm_manager *mgr) if (val & WINCONx_ENWIN) { fimd_enable_video_output(ctx, win, false); - /* unprotect windows */ - if (ctx->driver_data->has_shadowcon) { - val = readl(ctx->regs + SHADOWCON); - val &= ~SHADOWCON_CHx_ENABLE(win); - writel(val, ctx->regs + SHADOWCON); - } + if (ctx->driver_data->has_shadowcon) + fimd_enable_shadow_channel_path(ctx, win, + false); + ch_enabled = 1; } } @@ -759,11 +770,8 @@ static void fimd_win_commit(struct exynos_drm_manager *mgr, int zpos) fimd_enable_video_output(ctx, win, true); - if (ctx->driver_data->has_shadowcon) { - val = readl(ctx->regs + SHADOWCON); - val |= SHADOWCON_CHx_ENABLE(win); - writel(val, ctx->regs + SHADOWCON); - } + if (ctx->driver_data->has_shadowcon) + fimd_enable_shadow_channel_path(ctx, win, true); /* Enable DMA channel and unprotect windows */ fimd_shadow_protect_win(ctx, win, false); @@ -779,7 +787,6 @@ static void fimd_win_disable(struct exynos_drm_manager *mgr, int zpos) struct fimd_context *ctx = mgr->ctx; struct fimd_win_data *win_data; int win = zpos; - u32 val; if (win == DEFAULT_ZPOS) win = ctx->default_win; @@ -800,13 +807,10 @@ static void fimd_win_disable(struct exynos_drm_manager *mgr, int zpos) fimd_enable_video_output(ctx, win, false); - /* unprotect windows */ - if (ctx->driver_data->has_shadowcon) { - val = readl(ctx->regs + SHADOWCON); - val &= ~SHADOWCON_CHx_ENABLE(win); - writel(val, ctx->regs + SHADOWCON); - } + if (ctx->driver_data->has_shadowcon) + fimd_enable_shadow_channel_path(ctx, win, false); + /* unprotect windows */ fimd_shadow_protect_win(ctx, win, false); win_data->enabled = false;