From patchwork Sat Aug 15 16:26:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 7021091 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2F701C05AC for ; Sat, 15 Aug 2015 16:26:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 572A6206BA for ; Sat, 15 Aug 2015 16:26:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A318206DB for ; Sat, 15 Aug 2015 16:26:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753461AbbHOQ0o (ORCPT ); Sat, 15 Aug 2015 12:26:44 -0400 Received: from mail-yk0-f173.google.com ([209.85.160.173]:35297 "EHLO mail-yk0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753216AbbHOQ0n (ORCPT ); Sat, 15 Aug 2015 12:26:43 -0400 Received: by ykbi184 with SMTP id i184so28633108ykb.2 for ; Sat, 15 Aug 2015 09:26:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5SgkvK9Xm8HJpiIAACp32igctiu96cVDPPXEeeo11pI=; b=JNpdyirbB0WnpH1ytIiMt91JszjHm9ECZ1wqlvTt7nSagzCSthBUuMCXNMFd+mI1cj bVQjiF7qrwP0s1msQQJK3RI4Jl8rObF6XdNQnHg2nIOurAKNYBDy+t9yt0SQjGB4xXvd O/hERFUhi773/n4PnmzNosWDEchXnWesw3uQn4Q+n2gWlrZtoBZCD3OJvM1gFSrpdzUS AvngoWxOr09yKW8dRFD9UAwphLdF5xLtMdwIKCO3Bgrqqdu7Y5GflTe54oMtze+7tlHa 1zZD6GZWdq4YdpyzJKKmvcxefu17s5zOoy9YTbavSGLy6eARiNv7hd79+oSUp1xvGnP8 o+qw== X-Received: by 10.170.208.140 with SMTP id z134mr40730351yke.76.1439656003060; Sat, 15 Aug 2015 09:26:43 -0700 (PDT) Received: from jade.localdomain ([187.64.235.140]) by smtp.gmail.com with ESMTPSA id m132sm8636775ywb.34.2015.08.15.09.26.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Aug 2015 09:26:42 -0700 (PDT) From: Gustavo Padovan To: linux-samsung-soc@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, inki.dae@samsung.com, jy0922.shim@samsung.com, tjakobi@math.uni-bielefeld.de, Gustavo Padovan Subject: [PATCH 07/11] drm/exynos: fimd: only finish update if START == START_S Date: Sat, 15 Aug 2015 13:26:16 -0300 Message-Id: <1439655980-32146-8-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1439655980-32146-1-git-send-email-gustavo@padovan.org> References: <1439655980-32146-1-git-send-email-gustavo@padovan.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Gustavo Padovan fimd_update_plane() programs BUF_START[win] and during the update BUF_START[win] is copied to BUF_START_S[win] (its shadow register) and starts scanning out, then it raises a irq. The fimd_irq_handler, in the case we have a pending_fb, will check the fb value was copied to START_S register and finish the update in case of success. Based on patch from Daniel Kurtz Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index d41aa6a..c87b791 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -59,6 +59,7 @@ #define VIDWnALPHA1(win) (VIDW_ALPHA + 0x04 + (win) * 8) #define VIDWx_BUF_START(win, buf) (VIDW_BUF_START(buf) + (win) * 8) +#define VIDWx_BUF_START_S(win, buf) (VIDW_BUF_START_S(buf) + (win) * 8) #define VIDWx_BUF_END(win, buf) (VIDW_BUF_END(buf) + (win) * 8) #define VIDWx_BUF_SIZE(win, buf) (VIDW_BUF_SIZE(buf) + (win) * 4) @@ -895,7 +896,7 @@ static const struct exynos_drm_crtc_ops fimd_crtc_ops = { static irqreturn_t fimd_irq_handler(int irq, void *dev_id) { struct fimd_context *ctx = (struct fimd_context *)dev_id; - u32 val, clear_bit; + u32 val, clear_bit, start, start_s; int win; val = readl(ctx->regs + VIDINTCON1); @@ -917,7 +918,10 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id) if (!plane->pending_fb) continue; - exynos_drm_crtc_finish_update(ctx->crtc, plane); + start = readl(ctx->regs + VIDWx_BUF_START(win, 0)); + start_s = readl(ctx->regs + VIDWx_BUF_START_S(win, 0)); + if (start == start_s) + exynos_drm_crtc_finish_update(ctx->crtc, plane); } if (ctx->i80_if) {