From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: TIMESTAMP register Date: Wed, 18 Apr 2012 08:35:55 +0100 Message-ID: <1334734573_17140@CP5-2952> References: <36D38C1F74839847A52A484C31F3E51A154A0E59@IRSMSX101.ger.corp.intel.com> <20120417193943.GR4104@phenom.ffwll.local> <36D38C1F74839847A52A484C31F3E51A154A12B9@IRSMSX101.ger.corp.intel.com> <20120417210418.GS4104@phenom.ffwll.local> <20120417162745.229b7608@bwidawsk.net> <1334706720_15611@CP5-2952> <36D38C1F74839847A52A484C31F3E51A154A153C@IRSMSX101.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (smtp.fireflyinternet.com [109.228.6.236]) by gabe.freedesktop.org (Postfix) with ESMTP id 52A229E74F for ; Wed, 18 Apr 2012 00:36:18 -0700 (PDT) In-Reply-To: <36D38C1F74839847A52A484C31F3E51A154A153C@IRSMSX101.ger.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: "Lawrynowicz, Jacek" , Ben Widawsky , Daniel Vetter Cc: "intel-gfx@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org On Wed, 18 Apr 2012 06:32:04 +0000, "Lawrynowicz, Jacek" wrote: > I think that ioctl to get GPU timestamp and its resolution would be the best > approach. > This ioctl won't be called very often so there's no need to sacrifice > simplicity for performance in this case. > Using clock_gettime() sounds like trouble to me. > How would you keep GPU and CPU time synchronized? The bspec explicitly says that the GPU timestamp is adjusted for changes in render frequency so that it is consistent. Similarly CLOCK_MONOTONIC. > Is forcewakeup necessary in case of a register which is not affected by gfx > reset? They are in the GT powerwell, so yes forcewake will be necessary for the read not to return garbage. The rule of thumb is to keep interfaces out of the kernel unless there is a compelling reason otherwise. I think there is a good reason for a ioctl(QUERY_COUNTER), but I can also see that you can implement proof-of-principle code for this ARB timer entirely in userspace. -Chris -- Chris Wilson, Intel Open Source Technology Centre