From patchwork Wed Apr 5 07:28:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 9663141 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 1E2D860353 for ; Wed, 5 Apr 2017 07:28:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F538284D5 for ; Wed, 5 Apr 2017 07:28:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0431728535; Wed, 5 Apr 2017 07:28:59 +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 7B2D2284D5 for ; Wed, 5 Apr 2017 07:28:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753791AbdDEH26 (ORCPT ); Wed, 5 Apr 2017 03:28:58 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:28484 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753993AbdDEH24 (ORCPT ); Wed, 5 Apr 2017 03:28:56 -0400 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 <0ONX00B9YE3Y9J20@mailout1.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Wed, 05 Apr 2017 08:28:46 +0100 (BST) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170405072845eucas1p159ef45c92f78bbe8f855149e1ea41ce2~yb8azTXOn3206832068eucas1p1L; Wed, 5 Apr 2017 07:28:45 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1.samsung.com (EUCPMTA) with SMTP id B4.B4.14140.0BC94E85; Wed, 5 Apr 2017 08:28:48 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170405072845eucas1p2d8c7305eddf3cb92869e3449e9511ce4~yb8aEWrIj2379823798eucas1p28; Wed, 5 Apr 2017 07:28:45 +0000 (GMT) X-AuditID: cbfec7ef-f796a6d00000373c-ab-58e49cb02b56 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BC.DF.20206.0CC94E85; Wed, 5 Apr 2017 08:29:04 +0100 (BST) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ONX000HIE3TW560@eusync3.samsung.com>; Wed, 05 Apr 2017 08:28:44 +0100 (BST) 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 8/9] drm/exynos/decon5433: kill BIT_SUSPENDED flag Date: Wed, 05 Apr 2017 09:28:36 +0200 Message-id: <1491377317-8042-9-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1491377317-8042-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRmVeSWpSXmKPExsWy7djPc7ob5jyJMDj5jtvi1rpzrBYbZ6xn tbjy9T2bxaT7E1gsZpzfx2Sx9shddgc2j/vdx5k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7SBGzwBVGifZvXewgU4UFnCTmPRUBqWERUJX4u6GTEcTm BQp/3XOHEWKbnMTNc51gMzkFnCXO7LgMNlMIqKa18TXLBEbeBYwMqxhFUkuLc9Nzi430ihNz i0vz0vWS83M3MQKDdduxn1t2MHa9Cz7EKMDBqMTDWzHtcYQQa2JZcWXuIUYJDmYlEd4f059E CPGmJFZWpRblxxeV5qQWH2I0BTpqIrOUaHI+MJLySuINTQzNLQ2NjC0szI2MlMR5p364Ei4k kJ5YkpqdmlqQWgTTx8TBKdXAKL3bJLDBbOWON88yGecKcy/Z/CIyWLlc1vCEX2Vna/CjcEeR rlD/7ijFi11ycj11FnK39eQWrTn5//w7vkXM23lMe+8o/z26TDgne/kPHu20+Zxhlw9E3TsZ VHow/K3FvOX8UfyarH2ZU4Kqlp1b073Dr4av8J3uHP9fPRc//g+y4nJ+JvhCiaU4I9FQi7mo OBEA5Bf6pGwCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170405072845eucas1p2d8c7305eddf3cb92869e3449e9511ce4 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: 20170405072845eucas1p2d8c7305eddf3cb92869e3449e9511ce4 X-RootMTR: 20170405072845eucas1p2d8c7305eddf3cb92869e3449e9511ce4 References: <1491377317-8042-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 Exynos tracked suspend state to prevent touching disabled HW. After fixing disable order in HDMI and moving TE handling to DECON it is not needed anymore - all IRQ handlers and callbacks touching HW are called only with enabled DECON. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 38 --------------------------- 1 file changed, 38 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index b81c12b..1cb4b86 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c @@ -47,10 +47,6 @@ static const char * const decon_clks_name[] = { "sclk_decon_eclk", }; -enum decon_flag_bits { - BIT_SUSPENDED -}; - struct decon_context { struct device *dev; struct drm_device *drm_dev; @@ -62,7 +58,6 @@ struct decon_context { struct clk *clks[ARRAY_SIZE(decon_clks_name)]; unsigned int irq; unsigned int te_irq; - unsigned long flags; unsigned long out_type; int first_win; spinlock_t vblank_lock; @@ -94,9 +89,6 @@ static int decon_enable_vblank(struct exynos_drm_crtc *crtc) struct decon_context *ctx = crtc->ctx; u32 val; - if (test_bit(BIT_SUSPENDED, &ctx->flags)) - return -EPERM; - val = VIDINTCON0_INTEN; if (ctx->out_type & IFTYPE_I80) val |= VIDINTCON0_FRAMEDONE; @@ -116,9 +108,6 @@ static void decon_disable_vblank(struct exynos_drm_crtc *crtc) { struct decon_context *ctx = crtc->ctx; - if (test_bit(BIT_SUSPENDED, &ctx->flags)) - return; - if (!(ctx->out_type & I80_HW_TRG)) disable_irq_nosync(ctx->te_irq); disable_irq_nosync(ctx->irq); @@ -172,9 +161,6 @@ static u32 decon_get_vblank_counter(struct exynos_drm_crtc *crtc) { struct decon_context *ctx = crtc->ctx; - if (test_bit(BIT_SUSPENDED, &ctx->flags)) - return 0; - return decon_get_frame_count(ctx, false); } @@ -205,9 +191,6 @@ static void decon_commit(struct exynos_drm_crtc *crtc) bool interlaced = false; u32 val; - if (test_bit(BIT_SUSPENDED, &ctx->flags)) - return; - if (ctx->out_type & IFTYPE_HDMI) { m->crtc_hsync_start = m->crtc_hdisplay + 10; m->crtc_hsync_end = m->crtc_htotal - 92; @@ -331,9 +314,6 @@ static void decon_atomic_begin(struct exynos_drm_crtc *crtc) { struct decon_context *ctx = crtc->ctx; - if (test_bit(BIT_SUSPENDED, &ctx->flags)) - return; - decon_shadow_protect(ctx, true); } @@ -354,9 +334,6 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, dma_addr_t dma_addr = exynos_drm_fb_dma_addr(fb, 0); u32 val; - if (test_bit(BIT_SUSPENDED, &ctx->flags)) - return; - if (crtc->base.mode.flags & DRM_MODE_FLAG_INTERLACE) { val = COORDINATE_X(state->crtc.x) | COORDINATE_Y(state->crtc.y / 2); @@ -407,9 +384,6 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc, struct decon_context *ctx = crtc->ctx; unsigned int win = plane->index; - if (test_bit(BIT_SUSPENDED, &ctx->flags)) - return; - decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, 0); } @@ -418,9 +392,6 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc) struct decon_context *ctx = crtc->ctx; unsigned long flags; - if (test_bit(BIT_SUSPENDED, &ctx->flags)) - return; - spin_lock_irqsave(&ctx->vblank_lock, flags); decon_shadow_protect(ctx, false); @@ -474,9 +445,6 @@ static void decon_enable(struct exynos_drm_crtc *crtc) { struct decon_context *ctx = crtc->ctx; - if (!test_and_clear_bit(BIT_SUSPENDED, &ctx->flags)) - return; - pm_runtime_get_sync(ctx->dev); exynos_drm_pipe_clk_enable(crtc, true); @@ -495,9 +463,6 @@ static void decon_disable(struct exynos_drm_crtc *crtc) synchronize_irq(ctx->te_irq); synchronize_irq(ctx->irq); - if (test_bit(BIT_SUSPENDED, &ctx->flags)) - return; - /* * We need to make sure that all windows are disabled before we * suspend that connector. Otherwise we might try to scan from @@ -511,8 +476,6 @@ static void decon_disable(struct exynos_drm_crtc *crtc) exynos_drm_pipe_clk_enable(crtc, false); pm_runtime_put_sync(ctx->dev); - - set_bit(BIT_SUSPENDED, &ctx->flags); } static irqreturn_t decon_te_irq_handler(int irq, void *dev_id) @@ -750,7 +713,6 @@ static int exynos5433_decon_probe(struct platform_device *pdev) if (!ctx) return -ENOMEM; - __set_bit(BIT_SUSPENDED, &ctx->flags); ctx->dev = dev; ctx->out_type = (unsigned long)of_device_get_match_data(dev); spin_lock_init(&ctx->vblank_lock);