Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753257AbdGGBe0 (ORCPT ); Thu, 6 Jul 2017 21:34:26 -0400 Received: from mail.netline.ch ([148.251.143.178]:38697 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753177AbdGGBeY (ORCPT ); Thu, 6 Jul 2017 21:34:24 -0400 Subject: Re: [PATCH 1/3] drm: Widen vblank count to 64 bits. Change vblank time precision to ns To: Keith Packard , Dave Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org References: <20170705221013.27940-1-keithp@keithp.com> <20170705221013.27940-2-keithp@keithp.com> <83a2dbe9-dfcb-e31e-fc7b-14c4364daea5@daenzer.net> <86o9sxd2sw.fsf@keithp.com> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Message-ID: Date: Fri, 7 Jul 2017 10:34:12 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <86o9sxd2sw.fsf@keithp.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KO1bmtNO8s46F46CxtkXdDD34VTQKUn9B" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2978 Lines: 86 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KO1bmtNO8s46F46CxtkXdDD34VTQKUn9B Content-Type: multipart/mixed; boundary="g94ADx0JPTgjBMbXMu4eKb02lqwPrhuSn"; protected-headers="v1" From: =?UTF-8?Q?Michel_D=c3=a4nzer?= To: Keith Packard , Dave Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Message-ID: Subject: Re: [PATCH 1/3] drm: Widen vblank count to 64 bits. Change vblank time precision to ns References: <20170705221013.27940-1-keithp@keithp.com> <20170705221013.27940-2-keithp@keithp.com> <83a2dbe9-dfcb-e31e-fc7b-14c4364daea5@daenzer.net> <86o9sxd2sw.fsf@keithp.com> In-Reply-To: <86o9sxd2sw.fsf@keithp.com> --g94ADx0JPTgjBMbXMu4eKb02lqwPrhuSn Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: quoted-printable On 07/07/17 12:04 AM, Keith Packard wrote: > Michel D=C3=A4nzer writes: >=20 >>> @@ -317,6 +317,9 @@ int via_driver_irq_postinstall(struct drm_device = *dev) >>> if (!dev_priv) >>> return -EINVAL; >>> =20 >>> + if (dev->driver->get_vblank_counter) >>> + dev->max_vblank_count =3D 0xffffffff; >> >> What's the purpose of this? All drivers providing get_vblank_counter >> should already initialize max_vblank_count correctly. >=20 > Yeah, I couldn't prove that this driver did that, Which driver? > and as Daniel says, we haven't ever audited the drivers to make sure > they do. I don't think that's what he meant, rather that with the change above, all drivers have to be audited to make sure the added assignment doesn't clobber an earlier assignment by the driver. > We have a check to see that they don't set max_vblank_count if they > don't provide a get function, but I can't find the matching check for > drivers that do provide a function and aren't setting max_vblank_count.= I don't think that's necessary, see drm_update_vblank_count:=20 if (dev->max_vblank_count !=3D 0) { /* trust the hw counter when it's around */ diff =3D (cur_vblank - vblank->last) & dev->max_vblank_count; } else [...] The hardware vblank counter is only used for updating the DRM vblank counter if dev->max_vblank_count !=3D 0. --=20 Earthling Michel D=C3=A4nzer | http://www.amd= =2Ecom Libre software enthusiast | Mesa and X developer --g94ADx0JPTgjBMbXMu4eKb02lqwPrhuSn-- --KO1bmtNO8s46F46CxtkXdDD34VTQKUn9B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iHEEARECADEWIQSwn681vpFFIZgJURRaga+OatuyAAUCWV7lGBMcbWljaGVsQGRh ZW56ZXIubmV0AAoJEFqBr45q27IA7tAAn1N7BG16XvjHBBkbbMbb4NjOhob/AKCm tpkD8mds+l+MD8Genu3bxyRvew== =4UP7 -----END PGP SIGNATURE----- --KO1bmtNO8s46F46CxtkXdDD34VTQKUn9B--