Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3233658ybd; Fri, 28 Jun 2019 05:15:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAiBhK7FdW5hmKa40ewKJJL0syCUEyubejo9JuHoZ1e5CGl1HKTYeXyccANBo3CvwD528m X-Received: by 2002:a17:902:59c8:: with SMTP id d8mr11555674plj.55.1561724101429; Fri, 28 Jun 2019 05:15:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561724101; cv=none; d=google.com; s=arc-20160816; b=izNstg/ecHEyCBjCQMhbL+zTNi6Hbd73POQYSYLljj/ZX/cIrdVUBeLwVqV7TP/1I2 1wh3ih40uwSBXQIyGgRmwtG4SK8IB6R9Ner0RIDhz6xiUr9QTrH+GmgVDOx+/BSWY+zs 1vgEV4qQ2toZgBJJUw9lJogkilWT7fGc18r0YEtjFF43rXX30QWt+6niGqKdAqTEQOOE S9+aqOdhgooTOzzKiIsM0pV/SSzPb0W5hlUwlIkyncB2D1GMfKBmPtMSCNgKPGaoB835 ZRHsTvkkg3J5tmIkXN/Drr6Eh0clo0gFHuZQOJZ0stS7LtYWV1ax9R48f0K4HsmXLhLc kCAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=qc0mIKSyd7vaVtFZn0/5avC+c4OuE5+tjM7firyBXHw=; b=gk2bGDcRfFQXwEmO/8rapPeICvIRu5Rekd2o1JAjXEfzmSShYJjYXLgxuMxQ8zrGkt Cd7vh8COfVVRQk0GXLdsoGEHVI5lKQpYBn1N/I4nYvevozLj22OPKabAFJJ4SOBIl8r6 5y7G4Gt+XBRnWo6/qvt14W+w8I5AFVnXaKNnL0GHt7CUdhf8btbB3Jtq7teaN9W2omjp u1Hwe6odHtLBbI2akiAhxZmlzA49StPCxqlwPCWoJua+HHwK5hm0GC2ZoWBIcGAxS+cD 2PLmlnD53/UnllNtM6Zb2fiiFxeLP6Mb3e7VzT21zP4fZRRRa5oZqyTfS2Z0bScYSL8O aFFQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s20si2102602plq.139.2019.06.28.05.14.43; Fri, 28 Jun 2019 05:15:01 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727189AbfF1MNV (ORCPT + 99 others); Fri, 28 Jun 2019 08:13:21 -0400 Received: from mga04.intel.com ([192.55.52.120]:32923 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726836AbfF1MNT (ORCPT ); Fri, 28 Jun 2019 08:13:19 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2019 05:13:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,427,1557212400"; d="scan'208";a="189422313" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga002.fm.intel.com with SMTP; 28 Jun 2019 05:13:15 -0700 Received: by stinkbox (sSMTP sendmail emulation); Fri, 28 Jun 2019 15:13:15 +0300 Date: Fri, 28 Jun 2019 15:13:15 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Robert Beckett Cc: dri-devel@lists.freedesktop.org, Maxime Ripard , linux-kernel@vger.kernel.org, David Airlie , Sean Paul Subject: Re: [PATCH v4 2/2] Revert "drm/vblank: Do not update vblank count if interrupts are already disabled." Message-ID: <20190628121315.GH5942@intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 28, 2019 at 01:05:32PM +0100, Robert Beckett wrote: > If interrupts are already disabled, then the timestamp for the vblank > does not get updated, causing a stale timestamp to be reported to > userland while disabling crtcs. > > This reverts commit 68036b08b91bc491ccc308f902616a570a49227c. Please cc the people involved in that. And I'd drop the lkml cc. > > Signed-off-by: Robert Beckett > --- > drivers/gpu/drm/drm_vblank.c | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c > index 7dabb2bdb733..aeb9734d7799 100644 > --- a/drivers/gpu/drm/drm_vblank.c > +++ b/drivers/gpu/drm/drm_vblank.c > @@ -371,25 +371,23 @@ void drm_vblank_disable_and_save(struct drm_device *dev, unsigned int pipe) > spin_lock_irqsave(&dev->vblank_time_lock, irqflags); > > /* > - * Update vblank count and disable vblank interrupts only if the > - * interrupts were enabled. This avoids calling the ->disable_vblank() > - * operation in atomic context with the hardware potentially runtime > - * suspended. > + * Only disable vblank interrupts if they're enabled. This avoids > + * calling the ->disable_vblank() operation in atomic context with the > + * hardware potentially runtime suspended. > */ > - if (!vblank->enabled) > - goto out; > + if (vblank->enabled) { > + __disable_vblank(dev, pipe); > + vblank->enabled = false; > + } > > /* > - * Update the count and timestamp to maintain the > + * Always update the count and timestamp to maintain the > * appearance that the counter has been ticking all along until > * this time. This makes the count account for the entire time > * between drm_crtc_vblank_on() and drm_crtc_vblank_off(). > */ > drm_update_vblank_count(dev, pipe, false); > - __disable_vblank(dev, pipe); > - vblank->enabled = false; > > -out: > spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags); > } > > -- > 2.18.0 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrj?l? Intel