Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7149297ybi; Mon, 8 Jul 2019 15:38:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqx11FQ3d7U3OEsZDbf44MT6tgi1o3ZEPHGmaUx/Ktzr0A7FkOH6z2DjC0ELOgmnsEj+o+CV X-Received: by 2002:a63:6c7:: with SMTP id 190mr26120836pgg.7.1562625484125; Mon, 08 Jul 2019 15:38:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625484; cv=none; d=google.com; s=arc-20160816; b=VxWgauJckYF8uQjc3kRT0Q91LMTdTwIIKxzGUC8X6Iu10Vesqx2xAePgdclyFu1C6o ahj1dz6OGPUCRpKwA8YOjCSrwvH+66fFG9Hvzj2wSPKHQJESQUVOV3Cvg2K0HYXtu+YH oqB6P64fFZ9h9neK9FaOnJymU7zZphNAImXrnZUwvyll/pu6WP3HL57EswlGiODdfmm3 drsIy5iXZQJHwZBbChQrUryinD0LqrtnbBYRz7KTtuF2gCU4k/9hNvTDZ/Ah61qDaqqR Y+4m4XaYPgvJL2dvgd/SbiL2dl6GIPI7c16bL4AmEerElHtyAVwDgQTSriSwLviCy5By IZ0A== 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=SXJsWFMQFCXvbTWYZ7cPoKczd3tZh0WMnt2F2kbBrDo=; b=Pnb0V6VQmCds/An9zATJ5tPz0KkdSGXX3iWuqep55CSCY6G7rxA4IRyaNzF+oRJY2D SwX13YBGdy2UHj0mbQKpLHdBnVx7WAxeGV+EurxXuSndpkrpEZozONzwn21jJA8/zh/l mBEAsombAL6DWsYd8oUl2jChmjjPdk0vyBIYX4k/S9xYdVhKN5fyiuDdOUS+Q3xV3o0T c/CKkuT43UNMCNwjVFScM5JSwSuVJYtEgI9Rds+aQw1AEnZc2s1Yj969nIh0bmrUB9jn F+rPwa2b7ffsxpg94+gTv8h/UeEovcMQf14R8RNowhhK8Xq9q9oWhuNFzGGU8hVn02e1 +B8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Him/r2Hs"; 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 v11si18877263plo.223.2019.07.08.15.37.49; Mon, 08 Jul 2019 15:38:04 -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="Him/r2Hs"; 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 S2388440AbfGHPZH (ORCPT + 99 others); Mon, 8 Jul 2019 11:25:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:52436 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388543AbfGHPZE (ORCPT ); Mon, 8 Jul 2019 11:25:04 -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 73C14204EC; Mon, 8 Jul 2019 15:25:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562599503; bh=pPvXy1dg4w7R9+7wjQwCiC2XVNsumn72yQ7jifnr8r8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Him/r2HsdoSrrp3T6ruIjV38vZkl8RqtyXUsH4ObErqBkDNywW2Pe1v8o3TJWqgH3 6MONPYsGo6g0pSQlcLTu6T7oSSCFpYlNpoi8tswv2CdrMxKKXQ4JxrQJthtY8FySQj ol5/J/0Eh1Zv8rpQa6ZYifF39VEq2+jjIqHBtEaI= 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 4.14 36/56] drm/imx: notify drm core before sending event during crtc disable Date: Mon, 8 Jul 2019 17:13:28 +0200 Message-Id: <20190708150523.216561571@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150514.376317156@linuxfoundation.org> References: <20190708150514.376317156@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 @@ -99,14 +99,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)