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: 8760551 Return-Path: X-Original-To: patchwork-linux-arm@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 249579F36E for ; Wed, 6 Apr 2016 10:17:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B704201D3 for ; Wed, 6 Apr 2016 10:17:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 899B9201BB for ; Wed, 6 Apr 2016 10:17:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ankVB-0000GW-2k; Wed, 06 Apr 2016 10:15:57 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ankV0-0000DF-73; Wed, 06 Apr 2016 10:15:47 +0000 Received: by mail-wm0-x243.google.com with SMTP id o129so2303147wmo.3; 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=GUMTYTGY5QlpcyJaiBisK8ZpCuxNvqzC53LPuw+0XtsVLADOmiBKn3uY6aUMeM7g23 H10LDv3uozPcLH2gjsECnYWPU7N2j7W3zp0r5qRRh1ekow/HB+hC6vs5GuQa07CzuiDk QKGkwGlR/IsOdYdiSP0NVV6SnT3ktPKe3/1MKnutR16fh/7Q4jsYsbmHocGE4kE2aGQd DZiX1tJjcbh87TIxhMCUmKIfqZHQ5iw7kXWFhTBapueJSwSgzWUEwCT7ZjH8rjQhFb0B ZI7J4Nv0d0mgUfF0UC259qu2EHGkXEMpQ64f3Z117mjVWxlRj5Vxu3BjNSoab9cyTzPo WqYw== X-Gm-Message-State: AD7BkJKgx0ZmwxpvraQpG3InLvwAXG93Ors3t4K/SfLvXZwA/+Zr5UXnZRi89+6R7ZBk/Q== 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160406_031546_464165_42EC177A X-CRM114-Status: GOOD ( 11.44 ) X-Spam-Score: -2.4 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , Tomeu Vizoso , David Airlie , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Mark Yao MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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