From patchwork Thu Dec 6 09:38:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10715515 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 A6432109C for ; Thu, 6 Dec 2018 09:39:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 937ED2DEF3 for ; Thu, 6 Dec 2018 09:39:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86A6C2DFDE; Thu, 6 Dec 2018 09:39:10 +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 ECA6C2DEF3 for ; Thu, 6 Dec 2018 09:39:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728250AbeLFJjJ (ORCPT ); Thu, 6 Dec 2018 04:39:09 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:59883 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728648AbeLFJjJ (ORCPT ); Thu, 6 Dec 2018 04:39:09 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181206093908euoutp01ff9b44d37f36753ca1a04d8c0af8a4d1~ttOYwmQA03275932759euoutp01c; Thu, 6 Dec 2018 09:39:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181206093908euoutp01ff9b44d37f36753ca1a04d8c0af8a4d1~ttOYwmQA03275932759euoutp01c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1544089148; bh=VyW9/SaomhypB9Dcjqc/7ims5HOEtPQercdH4auRgro=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=tNrI5VDB8PZuAXmNPtjSw7KVU/U8Ruzd3TyqAQYqczYuVme0/nOrz9eDnFTDnBF3o 5TM21daB4ziuUPzyf9ZuMAVbo9jjCGgvfh2M5RZBxyuIba1SA8LTh2+codDht3OB4x bhbhWhEgsQpFsz39qxrsEo/SDU9FIw7akQ0Z6q+M= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181206093907eucas1p2e20ebb1a235e462c18d477c440aefb38~ttOYTv4cX1560315603eucas1p2S; Thu, 6 Dec 2018 09:39:07 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 4D.85.04806.B3EE80C5; Thu, 6 Dec 2018 09:39:07 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181206093906eucas1p201bdbdc03cabc2a3f60ea04b794ffd04~ttOXUqs5M1563515635eucas1p2M; Thu, 6 Dec 2018 09:39:06 +0000 (GMT) X-AuditID: cbfec7f5-367ff700000012c6-f0-5c08ee3b946c Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 2F.44.04128.A3EE80C5; Thu, 6 Dec 2018 09:39:06 +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 <0PJB000UL6T4U830@eusync1.samsung.com>; Thu, 06 Dec 2018 09:39:06 +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 2/3] drm/exynos/fimd: create local helper for disabling hardware window Date: Thu, 06 Dec 2018 10:38:56 +0100 Message-id: <20181206093857.22324-3-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181206093857.22324-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNIsWRmVeSWpSXmKPExsWy7djP87rW7zhiDO4c4Le4te4cq8XGGetZ La58fc9mMen+BBaLGef3MVmsPXKX3YHN4373cSaPvi2rGD0+b5ILYI7isklJzcksSy3St0vg ymh+MYW5YJNgxZT39xgbGLfydTFyckgImEi8WzaXvYuRi0NIYAWjxPY9z5kgnM+MEl/3TGOG qVrT1cIGYgsJLGOUuL6/AqLoP6PErq9fWUASbAKaEn833wQrEhFQlli1rx1sLLPAJUaJ1ye7 GUESwgKREmf+nAUrYhFQlbi9ayJYM6+AhcTXB2eZILbJS6zecABsM6eApcT7NU9YQAZJCHxk lZi59TI7RJGLxJNlN6AahCVeHd8CFZeRuDy5mwXCrpdomnmFGaK5g1HixOLlbBAJa4nDxy+y gtjMAnwSk7ZNByriAIrzSnS0CUGUeEhMn7CMDeLNHkaJm/O2sU1glFzAyLCKUTy1tDg3PbXY OC+1XK84Mbe4NC9dLzk/dxMjMMpO/zv+dQfjvj9JhxgFOBiVeHhfPGCPEWJNLCuuzD3EKMHB rCTCy6DHESPEm5JYWZValB9fVJqTWnyIUZqDRUmct5rhQbSQQHpiSWp2ampBahFMlomDU6qB 8fIqbvOQnxMyNu489FnB0mVzZM/a/NKFja1eGnkXlb4/CF40hc2eaXPu7Kem5bpHxeQv8+Us CDnqnjlHpHGL+BTDaa1eIcf3Tr3ynsGF76eu4NNS/8rYiT6vg9mFPx58ktLRIXPnxLdPn+9e sNnZNad2/VxOOam2R1m3ww6r3T6YaDhFjrMxTYmlOCPRUIu5qDgRAB8sRH+uAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJJMWRmVeSWpSXmKPExsVy+t/xy7pW7zhiDC4ekbK4te4cq8XGGetZ La58fc9mMen+BBaLGef3MVmsPXKX3YHN4373cSaPvi2rGD0+b5ILYI7isklJzcksSy3St0vg ymh+MYW5YJNgxZT39xgbGLfydTFyckgImEis6Wph62Lk4hASWMIo8af9IyOE08gk8XjBKlaQ KjYBTYm/m2+ygdgiAsoSq/a1s4MUMQtcYZRo/9bFDpIQFoiUOPPnLFgRi4CqxO1dE1lAbF4B C4mvD84yQayTl1i94QAziM0pYCnxfs0TsBohoJpJy3eyT2DkWcDIsIpRJLW0ODc9t9hIrzgx t7g0L10vOT93EyMwQLYd+7llB2PXu+BDjAIcjEo8vC8esMcIsSaWFVfmHmKU4GBWEuFl0OOI EeJNSaysSi3Kjy8qzUktPsQozcGiJM573qAySkggPbEkNTs1tSC1CCbLxMEp1cA4wyvU8M9v LbtvKae5Ga9cYs9mOeX4S3ftEX9t/oC1bm5pu55vXczqUGERLmarsujN9LUnlRm3dfz9cOap bVx6TdjHJ7rJXe8LpvQfclzRUbBb5LzWl259vRBF3yUWux5ZxrgdOyFSF3V6ZyWLvbW4zt5f G72dRPe0O5b1cfp4bY9fzHue/YYSS3FGoqEWc1FxIgBc213dDAIAAA== X-CMS-MailID: 20181206093906eucas1p201bdbdc03cabc2a3f60ea04b794ffd04 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181206093906eucas1p201bdbdc03cabc2a3f60ea04b794ffd04 References: <20181206093857.22324-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 b7f56935a46b..226127f35052 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -331,6 +331,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; @@ -349,12 +357,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; } } @@ -805,15 +808,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) @@ -848,7 +847,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);