Received: by 10.213.65.68 with SMTP id h4csp538784imn; Wed, 4 Apr 2018 03:00:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/P9QD61EqyZf9GNfFcu8EIGsu/FRafBs5DHQpu1hzzp1Zbp6Eb/0EQuDZvP5kPX1G9hVpI X-Received: by 2002:a17:902:464:: with SMTP id 91-v6mr17786495ple.126.1522836042406; Wed, 04 Apr 2018 03:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522836042; cv=none; d=google.com; s=arc-20160816; b=kR2deNJRbQsnHIcTgR5Dn3pftYWB0sGT6coSAYRuAqIydepeOO5Ivj6Bj/rPi22jmB NZhlNThKiRYF4wXQh0TbdWNL7Ga3wP5KFv+9A1vEGaAt+2DYxML8lSmWJPNX60QoiF16 cqXZyDBOTBwz3bZIn2fJgniKq/7F6nZI7VGOOV7hrFX0nPOCMLUx7hGEM/l9pYbqw+DU GbuUJbfYa8CgCi/thBKI4A5q0inA1KBQC+1w8pdsf54SGvVk8Bh/NBU4pfzJDDcPSKr7 vBEe/qRiEr79s3hC0KvPvQWosgoDQP6P/qZptWCfU56z8x8ZljsMvyu1uoDAkwlnT6iL KbLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=LQAZ5D3vxqmX8t58Jv21r57f00LWvMRm+O/6u3xwoiQ=; b=lg8oquPXdR1PNopEie6mC13obpg6Cr2/UEUFXCc/P7ZHgPKa4n3sU1Oc3QnWSuDsnD Do8qB0/d7Rj2l+/0E2rxd09J0e7naolCKtdyCEJW+cQ7aQCSBZyRpCdqrTjiCfrEx82b Z7hm5wfrjmjENdbXJslIoFAFW3csdQzMVmOaOIUPtIW792liNxtu1qibhY5WoOdUonDt vQgsTrdkG5YF5QFjJICg33XZ3Mp2xBYjHeGEisUxcVyfdNgkQ21nfGfQLOt7iT+RZuGa p4eMYy22GmE9Yhf4eoGKodQnGd7cCATNaDn5dts1VNHy3m2K82jbf7NaQL8enxjkcGzq L5nQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t20si3763299pfk.228.2018.04.04.03.00.28; Wed, 04 Apr 2018 03:00:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751329AbeDDJ5q (ORCPT + 99 others); Wed, 4 Apr 2018 05:57:46 -0400 Received: from mail.bootlin.com ([62.4.15.54]:42910 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751236AbeDDJ5c (ORCPT ); Wed, 4 Apr 2018 05:57:32 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 38C9F2037A; Wed, 4 Apr 2018 11:57:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 07AA12037A; Wed, 4 Apr 2018 11:57:21 +0200 (CEST) From: Maxime Ripard To: Thierry Reding , Chen-Yu Tsai , Maxime Ripard , Mark Rutland , Rob Herring , Frank Rowand Cc: dri-devel@lists.freedesktop.org, Gustavo Padovan , Daniel Vetter , Maarten Lankhorst , Sean Paul , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Petazzoni Subject: [PATCH v4 1/8] drm/sun4i: tcon: Add TRI finish interrupt for vblank Date: Wed, 4 Apr 2018 11:57:09 +0200 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The "CPU" (or Intel 8080) interface uses a different interrupt called TRI_FINISH (most likely TRI being for trigger) to notify the end of frames, and hence the VBLANK period. And that interrupt to the possible VBLANK interrupts source. Reviewed-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 9 ++++++--- drivers/gpu/drm/sun4i/sun4i_tcon.h | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index c3d92d537240..5f423ed2f01b 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -201,7 +201,8 @@ void sun4i_tcon_enable_vblank(struct sun4i_tcon *tcon, bool enable) DRM_DEBUG_DRIVER("%sabling VBLANK interrupt\n", enable ? "En" : "Dis"); mask = SUN4I_TCON_GINT0_VBLANK_ENABLE(0) | - SUN4I_TCON_GINT0_VBLANK_ENABLE(1); + SUN4I_TCON_GINT0_VBLANK_ENABLE(1) | + SUN4I_TCON_GINT0_TCON0_TRI_FINISH_ENABLE; if (enable) val = mask; @@ -582,7 +583,8 @@ static irqreturn_t sun4i_tcon_handler(int irq, void *private) regmap_read(tcon->regs, SUN4I_TCON_GINT0_REG, &status); if (!(status & (SUN4I_TCON_GINT0_VBLANK_INT(0) | - SUN4I_TCON_GINT0_VBLANK_INT(1)))) + SUN4I_TCON_GINT0_VBLANK_INT(1) | + SUN4I_TCON_GINT0_TCON0_TRI_FINISH_INT))) return IRQ_NONE; drm_crtc_handle_vblank(&scrtc->crtc); @@ -591,7 +593,8 @@ static irqreturn_t sun4i_tcon_handler(int irq, void *private) /* Acknowledge the interrupt */ regmap_update_bits(tcon->regs, SUN4I_TCON_GINT0_REG, SUN4I_TCON_GINT0_VBLANK_INT(0) | - SUN4I_TCON_GINT0_VBLANK_INT(1), + SUN4I_TCON_GINT0_VBLANK_INT(1) | + SUN4I_TCON_GINT0_TCON0_TRI_FINISH_INT, 0); if (engine->ops->vblank_quirk) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h b/drivers/gpu/drm/sun4i/sun4i_tcon.h index 161e09427124..2e0fb9640ed9 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.h +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h @@ -28,7 +28,11 @@ #define SUN4I_TCON_GINT0_REG 0x4 #define SUN4I_TCON_GINT0_VBLANK_ENABLE(pipe) BIT(31 - (pipe)) +#define SUN4I_TCON_GINT0_TCON0_TRI_FINISH_ENABLE BIT(27) +#define SUN4I_TCON_GINT0_TCON0_TRI_COUNTER_ENABLE BIT(26) #define SUN4I_TCON_GINT0_VBLANK_INT(pipe) BIT(15 - (pipe)) +#define SUN4I_TCON_GINT0_TCON0_TRI_FINISH_INT BIT(11) +#define SUN4I_TCON_GINT0_TCON0_TRI_COUNTER_INT BIT(10) #define SUN4I_TCON_GINT1_REG 0x8 #define SUN4I_TCON_FRM_CTL_REG 0x10 -- git-series 0.9.1