From patchwork Wed Apr 6 10:14:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8760441 Return-Path: X-Original-To: patchwork-dri-devel@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 128E49F36E for ; Wed, 6 Apr 2016 10:15:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C802B201EC for ; Wed, 6 Apr 2016 10:15:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E5B2A201DD for ; Wed, 6 Apr 2016 10:15:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 384266E41C; Wed, 6 Apr 2016 10:15:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9E0AF6E41C for ; Wed, 6 Apr 2016 10:15:27 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id i204so11778306wmd.0 for ; Wed, 06 Apr 2016 03:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=6etgqEgG3axCgVmI7ncYx1mMO9PIxcTVaC3kTY8+zGY=; b=IaKWIOHI1wYS354SoDkHaiUFvJA2sGuJzjOu7Yh25XeTEYHrFXFueeKREKJ0J5fawX RaWMDSeibtNL3Wei9wdygnxm3hNcfPCb5c5ypDBTKhEe7YBat4MSgWuH3l9Z5s/XPLeV 9DVvxxFKEjxueAOyQhpNVAflCBA0sfWejeiCEeEFnMFjKBytaGYCE/OVLzzf2xIx/tGf k0dcmoojv2SPxXQe3d7UGWFicKbITYX5NYGwpuwPpgiIZde36CHjMahYPj5Sbc1NRENt kWhaagd5aZ+itkGR6dDJ1rOu4jF/nBMkk+mpTpiUo7BVDvCaSrZ0SBinjWa2RMRUCeD7 yHFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=6etgqEgG3axCgVmI7ncYx1mMO9PIxcTVaC3kTY8+zGY=; b=J+crV35lrKL2r3J8RbCrHdcyszxuGKwXwSoFNs3ce9r7LwcsnF1QIaZmjiBobKJNrd e1D155Ara1atHnJ4NnxbKFu8GCUdokB8SoZ3sFM/+2h9bpR73xUFDyE2rnIWsc6JgS6+ 0Jyu3JVIKkFauFlin1dOkaR8w4j9rAoyVjlMksnxn14irU0RgR26CDNcNsdOCi8CnBMZ tJet5Iuk5VwwoBfBdeTtIH/4s8oUfHBBjKTYiEBhQOl2iWx8hESIdC9FefokyEC0WCt+ P0chVbY8k33vCYbq/BxrFlELrlkf9VoU05bFrO8AhnmRaESD8WEgpgWMshYMeY+M2kMN Rz1Q== X-Gm-Message-State: AD7BkJJ/116PQv4RN10s42KeZsqTUY0afa9YSVofE+HF7TDEZkswwvagKgswXNjGqBY0Fg== X-Received: by 10.28.179.84 with SMTP id c81mr23282977wmf.13.1459937726402; Wed, 06 Apr 2016 03:15:26 -0700 (PDT) Received: from cizrna.lan ([109.72.12.179]) by smtp.gmail.com with ESMTPSA id jk1sm2449545wjb.27.2016.04.06.03.15.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Apr 2016 03:15:25 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] drm/rockchip: vop: Wait for pending events when disabling a CRTC Date: Wed, 6 Apr 2016 12:14:46 +0200 Message-Id: <1459937686-9142-2-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1459937686-9142-1-git-send-email-tomeu.vizoso@collabora.com> References: <1459937686-9142-1-git-send-email-tomeu.vizoso@collabora.com> Cc: Tomeu Vizoso , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 When a VOP is disabled, it will stop raising interrupts. If we had a pending pageflip when the VOP is disabled, userspace won't get that event until the corresponding CRTC is enabled again. So let's wait for any pending events that may be right before disabling a CRTC. Signed-off-by: Tomeu Vizoso --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index f46b1fd1887b..6dc87fa96f29 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -142,6 +142,8 @@ struct vop { struct vop_win win[]; }; +static void vop_crtc_wait_for_update(struct drm_crtc *crtc); + static inline void vop_writel(struct vop *vop, uint32_t offset, uint32_t v) { writel(v, vop->regs + offset); @@ -504,6 +506,9 @@ static void vop_crtc_disable(struct drm_crtc *crtc) if (!vop->is_enabled) return; + if (crtc->state->event || vop->event) + vop_crtc_wait_for_update(crtc); + /* * We need to make sure that all windows are disabled before we * disable that crtc. Otherwise we might try to scan from a destroyed