Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7151326ybi; Mon, 8 Jul 2019 15:40:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXnzSpQakOxAxKcH5FPcaQ+UDq6R6+In76nvR0F5A8kmA2Boc5upLdyKT+tGbUWaeDyGCR X-Received: by 2002:a17:902:7083:: with SMTP id z3mr23557195plk.278.1562625648035; Mon, 08 Jul 2019 15:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625648; cv=none; d=google.com; s=arc-20160816; b=o91/EgMIXD4ffRAJpS5qAcaTpIuujtkWS1Zpj4e6rTDZorEdRz4H+IsN3L9f1pyhf4 oPgP1/v1ZW68Mb4XhFlVLDPBz7R9scMzUqNjhRDLmR6hJap3aCfTNkwrGGNoZ6Ekco4B KcTW6/2RB6Q5tewUnERtTiJ8/ils9LGALBAnx7woabL0ZFGKrA+uAfvqlllwRHKHHMQW +ImVvi+NcacJhprP2OxG/AoaDOTAckygI6tU2H7XPPBXu9fXhMu7E3Jm3Bd5bmMhwpPv AiRJ33WOic5IU0xAcv00LW9ty4faU2Sgjr+IWMSaXiUKZcG4o6Xb3YIUI5Ifv8H521Oe h5hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=phedEv41EnZKCnvHn8sAqhs84oqdciHgOlEj2Pgrwd8=; b=yZI98DGp+R6pxXSfPK8YZz8PLQkOu3l+v9RqWSyBvuT/h9WYgsnxT4qtRLuOAz0g/W CIM343ZLhmW/LG4EAJLDmDQKj38uixnjK8P/+L+NUb6mQ+stCmKhKxXl72BLBOXwVt5c G2+QF6Bnpd5HXehsLWQloa/gxuzf4VNPK2XXQj0SNhcJMPS62QSUTde90Yp3hpB4Hjng gcgfTYJ84x184JZi7jkt0fpBdtNiLWZseD4mA/ZdfJvZcrJFHO2gqrrlmwNTSRUbjAPh 1iQJfU1rzvj9vbZxB9q7gr46Jb7kZK/hBe3niLdeEofdICUdRIRAbqtrArg8ubLDeydF Thpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MARRSOA7; 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 g20si20396444pfh.95.2019.07.08.15.40.33; Mon, 08 Jul 2019 15:40:48 -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; dkim=pass header.i=@kernel.org header.s=default header.b=MARRSOA7; 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 S2390522AbfGHPeU (ORCPT + 99 others); Mon, 8 Jul 2019 11:34:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:36432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390491AbfGHPeN (ORCPT ); Mon, 8 Jul 2019 11:34:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DA53620651; Mon, 8 Jul 2019 15:34:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562600052; bh=9sFgVlBKIkdFlAhyL4/acUTis8dD4cFBb8phPTIZ2Bg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MARRSOA7ez8MLQqZRHtafgjLcPRGuyP7Wlae1a+ILtyEm25RbeJ4bjYQvtIBd/PBK dI/9Mln6z9Kx6nN8g8ny5Lzj9AugNhNEBs35tcnmyz1FqDViaY6HcCozwbnvMns1KN DwbXE203RUzcqob4p1jU05LjITPYq6W0zg67Tdys= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Beckett , Daniel Vetter , Philipp Zabel Subject: [PATCH 5.1 78/96] drm/imx: notify drm core before sending event during crtc disable Date: Mon, 8 Jul 2019 17:13:50 +0200 Message-Id: <20190708150530.677061754@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150526.234572443@linuxfoundation.org> References: <20190708150526.234572443@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robert Beckett commit 78c68e8f5cd24bd32ba4ca1cdfb0c30cf0642685 upstream. Notify drm core before sending pending events during crtc disable. This fixes the first event after disable having an old stale timestamp by having drm_crtc_vblank_off update the timestamp to now. This was seen while debugging weston log message: Warning: computed repaint delay is insane: -8212 msec This occurred due to: 1. driver starts up 2. fbcon comes along and restores fbdev, enabling vblank 3. vblank_disable_fn fires via timer disabling vblank, keeping vblank seq number and time set at current value (some time later) 4. weston starts and does a modeset 5. atomic commit disables crtc while it does the modeset 6. ipu_crtc_atomic_disable sends vblank with old seq number and time Fixes: a474478642d5 ("drm/imx: fix crtc vblank state regression") Signed-off-by: Robert Beckett Reviewed-by: Daniel Vetter Signed-off-by: Philipp Zabel Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/imx/ipuv3-crtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c @@ -91,14 +91,14 @@ static void ipu_crtc_atomic_disable(stru ipu_dc_disable(ipu); ipu_prg_disable(ipu); + drm_crtc_vblank_off(crtc); + spin_lock_irq(&crtc->dev->event_lock); if (crtc->state->event) { drm_crtc_send_vblank_event(crtc, crtc->state->event); crtc->state->event = NULL; } spin_unlock_irq(&crtc->dev->event_lock); - - drm_crtc_vblank_off(crtc); } static void imx_drm_crtc_reset(struct drm_crtc *crtc)