From patchwork Wed Aug 26 17:43:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 7078891 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2E6539F358 for ; Wed, 26 Aug 2015 17:43:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 54E7920949 for ; Wed, 26 Aug 2015 17:43:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B3C320945 for ; Wed, 26 Aug 2015 17:43:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752811AbbHZRn4 (ORCPT ); Wed, 26 Aug 2015 13:43:56 -0400 Received: from mail-qk0-f169.google.com ([209.85.220.169]:35675 "EHLO mail-qk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752307AbbHZRnz (ORCPT ); Wed, 26 Aug 2015 13:43:55 -0400 Received: by qkbm65 with SMTP id m65so123604950qkb.2 for ; Wed, 26 Aug 2015 10:43:54 -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=WvFuxUzqvlHGJJbbtCz2W5Rvv1bWpH+Bp50oAPh0KIA=; b=lPO+ktT0GtaQGixgBqKDMqlAmCFfUpCG49PhWWBrhBdkRtOqQOCxh5MZg6XSEp0JMu TQploSTY0XtD4/+Xf7lCGd9RAGPFwqk4L522DltzPCtBOmvEUGZCrFXh0BrFR7HQwmVg 94rGOoKgPOzsYuuLpbf0PRtDx84tqJKbkMXcrbeL9Bd+92GSguYW/PlI1JUxrZve/8Z6 wNxA5xPNB0Vi6rvkDOUM8KehVhsUfb2ytCpfOtIJq0xaRpGtP6OJQlAilmYz8ofKy81X Q1g1C0E3k0+QBtIpYna/H0JdGdzOHnACxn8W5ulE7Iejr6bFjdZezeibVM1d2gCZaeCC va7w== X-Received: by 10.55.41.10 with SMTP id p10mr80058674qkh.28.1440611034762; Wed, 26 Aug 2015 10:43:54 -0700 (PDT) Received: from jade.localdomain ([179.98.13.55]) by smtp.gmail.com with ESMTPSA id o96sm16856202qgd.23.2015.08.26.10.43.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2015 10:43:54 -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 v2 07/11] drm/exynos: fimd: only finish update if START == START_S Date: Wed, 26 Aug 2015 14:43:24 -0300 Message-Id: <1440611008-3473-9-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1440611008-3473-1-git-send-email-gustavo@padovan.org> References: <1440611008-3473-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=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 fc26c3e..d96044f 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) {