Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp977004imm; Wed, 26 Sep 2018 09:37:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV6133tYHbV29hrnrQXutduOnLZuOyTcykiaLmJ51MSQ0NEBQskPFV1ENcmw1ZIvlzvWkVtEg X-Received: by 2002:a17:902:d715:: with SMTP id w21-v6mr6699849ply.143.1537979868250; Wed, 26 Sep 2018 09:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537979868; cv=none; d=google.com; s=arc-20160816; b=DEu4kXfzqe2ooxbqHcFOysYYQG0WjFJcaeX3PvnPHNgz7bvYxcX2q+fxKOomrvup+t aJaHg/kzJiTxl3RnvYqv37SgwZAFzfDmxoGfCiAvUSio7A3MramV+gTk1VjoVBIeNLzB RuEUhxR0b7lUhS4ZMhM2d55VLGzK0IzjGKxaMOzvaZxnGHFStSpPJoFcTwXb9gll2ygG /wRl8DNfDBGf2fV7uVJKbZT58EKadQMHQBGwGbXKIKmKPlJzZmOMGZlXWGASzwYxiliO Bj/9bezvYWHAa4grTnnVihjGp3uSAV9Z/0RaRQDj+UOJ3y2Yi+ubL6209KNBYlgev4ui IgMw== 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=c8WwNVa0e5RtA+fU/ZydCUdp+qmzHKCzQNI2f65GSTA=; b=n7IoLbuLORkWyJEI+KttljMn1WNunwZkhfLOHZJLHlOH1MxeX+eSv5djNLTeS1O+5j vCEXQ2woOIakCzlB0gVlk4a8d0ezWGcDVRG10obw4PsMq9CUa/+uO//4XOVauaHvrEFT KV0suZrnkWb68spgWPvXR9XARJFNmzOlHwgXsYWmOUcy/3nQtrMtkXmIIutg4dEaee7z AgdS4D4IzpchEzdF1ldHjPWuseZKp7fWwW3UhIacb89nIXitbXTMC0ujL1qxVpZKU5oN vBOxHJsRV0Us+iX8WsLvigsI+wDvjmW8jlWnv0sJR60NU18yQiy3Kyw59AaCFQz8Mjwh HOjg== 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 68-v6si5420835pga.113.2018.09.26.09.37.33; Wed, 26 Sep 2018 09:37: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; 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 S1728310AbeIZWvP (ORCPT + 99 others); Wed, 26 Sep 2018 18:51:15 -0400 Received: from mga09.intel.com ([134.134.136.24]:43524 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727692AbeIZWvP (ORCPT ); Wed, 26 Sep 2018 18:51:15 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 09:37:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,306,1534834800"; d="scan'208";a="77477128" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga006.jf.intel.com with SMTP; 26 Sep 2018 09:37:24 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 26 Sep 2018 19:37:23 +0300 Date: Wed, 26 Sep 2018 19:37:23 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Eugeniy Paltsev Cc: dri-devel@lists.freedesktop.org, David Airlie , Alexey Brodkin , linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-snps-arc@lists.infradead.org, Sean Paul Subject: Re: [PATCH] DRM: VBLANK: provide valid timestamp for EVENT_FLIP Message-ID: <20180926163723.GW9144@intel.com> References: <20180926142535.17997-1-Eugeniy.Paltsev@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180926142535.17997-1-Eugeniy.Paltsev@synopsys.com> 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 Wed, Sep 26, 2018 at 05:25:35PM +0300, Eugeniy Paltsev wrote: > If driver/HW doesn't support vblank functionality (for example > UDL driver, ARCPGU driver, ...) we always have vblank->time == 0. > In result we always provide zero timestamp for > DRM_EVENT_FLIP_COMPLETE. This breaks userspace apps (for example > weston) which relies on timestamp value. > > Setup time to provide valid timestamp for DRM_EVENT_FLIP_COMPLETE > event. > > Cc: stable@vger.kernel.org > Signed-off-by: Eugeniy Paltsev > --- > drivers/gpu/drm/drm_vblank.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c > index 28cdcf76b6f9..0d19aca48782 100644 > --- a/drivers/gpu/drm/drm_vblank.c > +++ b/drivers/gpu/drm/drm_vblank.c > @@ -911,6 +911,15 @@ void drm_crtc_send_vblank_event(struct drm_crtc *crtc, > > if (dev->num_crtcs > 0) { If those drivers don't support vblank stuff why are they calling drm_vblank_init() w/ num_crtcs > 0? If they didn't they'd take the else branch which already does what you want. > seq = drm_vblank_count_and_time(dev, pipe, &now); > + > + /* > + * If driver/HW doesn't support vblank functionality we > + * always have vblank->time == 0. Setup time to provide valid > + * timestamp for DRM_EVENT_FLIP_COMPLETE event. > + */ > + if (!now && e->event.base.type == DRM_EVENT_FLIP_COMPLETE) > + now = ktime_get(); > + > } else { > seq = 0; > > -- > 2.14.4 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrj?l? Intel