From: Chris Wilson Subject: Re: [PATCH] drm: Don't pass negative delta to ktime_sub_ns() Date: Wed, 12 Jun 2013 11:48:13 +0100 Message-ID: <20130612104812.GF32648@cantiga.alporthouse.com> References: <1371031124-8867-1-git-send-email-michel@daenzer.net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from fireflyinternet.com (s16502780.onlinehome-server.info [87.106.93.118]) by gabe.freedesktop.org (Postfix) with ESMTP id 6ABF1E5E0E for ; Wed, 12 Jun 2013 03:48:16 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1371031124-8867-1-git-send-email-michel@daenzer.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Michel =?iso-8859-1?Q?D=E4nzer?= Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Wed, Jun 12, 2013 at 11:58:44AM +0200, Michel D=E4nzer wrote: > From: Michel D=E4nzer > = > It takes an unsigned value. This happens not to blow up on 64-bit > architectures, but it does on 32-bit, causing > drm_calc_vbltimestamp_from_scanoutpos() to calculate totally bogus > timestamps for vblank events. Which in turn causes e.g. gnome-shell to > hang after a DPMS off cycle with current xf86-video-ati Git. > = > Cc: stable@vger.kernel.org > Signed-off-by: Michel D=E4nzer iiuc, this occurs when compensating for the early vblank interrupt. However, #define ktime_sub_ns(kt, nsval) \ ({ (ktime_t){ .tv64 =3D (kt).tv64 - (nsval) }; }) so both tv64 and delta_ns are s64. I am not seeing the unsigned promotion bug here. -Chris -- = Chris Wilson, Intel Open Source Technology Centre