[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0102019199bda302-994c7da8-9e5a-4a2e-8e2a-6ef5f354ed59-000000@eu-west-1.amazonses.com>
Date: Wed, 28 Aug 2024 16:07:07 +0000
From: Boris Brezillon <boris.brezillon@...labora.com>
To: Mihail Atanassov <mihail.atanassov@....com>
Cc: Mary Guillemard <mary.guillemard@...labora.com>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
kernel@...labora.com, Christopher Healy <healych@...zon.com>,
Steven Price <steven.price@....com>,
Liviu Dudau <liviu.dudau@....com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
nd@....com
Subject: Re: [PATCH] drm/panthor: Add DEV_QUERY_TIMESTAMP_INFO dev query
On Wed, 28 Aug 2024 14:22:51 +0100
Mihail Atanassov <mihail.atanassov@....com> wrote:
> Hi Boris,
>
> On 28/08/2024 13:09, Boris Brezillon wrote:
> > Hi Mihail,
> >
> > On Thu, 8 Aug 2024 12:41:05 +0300
> > Mihail Atanassov <mihail.atanassov@....com> wrote:
> >
> >>>
> >>> +/** + * struct drm_panthor_timestamp_info - Timestamp information +
> >>> * + * Structure grouping all queryable information relating to the
> >>> GPU timestamp. + */ +struct drm_panthor_timestamp_info { + /**
> >>> @timestamp_frequency: The frequency of the timestamp timer. */ +
> >>> __u64 timestamp_frequency; + + /** @current_timestamp: The current
> >>> timestamp. */ + __u64 current_timestamp;
> >>
> >> As it stands, this query has nothing to do with the actual GPU so
> >> doesn't really belong here.
> >>
> >> It'd be more valuable, and can maybe give better calibration results
> >> than querying the system timestamp separately in userspace, if you
> >> reported all of:
> >> * the system timer value
> >> * the system timer frequency
> >> * the GPU timer value
> >> * the GPU timer frequency (because it _could_ be different in some
> >> systems)
> >
> > Duh, I wish this wasn't the case and all SoC vendors went for the
> > arch-timer which guarantees the consistency of the timestamp on the GPU
> > and CPU. But let's say this is a case we need to support, wouldn't it
> > be more useful to do the CPU/GPU calibration kernel side (basically at
> > init/resume time) and then expose the formula describing the
> > relationship between those 2 things:
> >
> > CPU_time = GPU_time * GPU_to_CPU_mul / GPU_to_CPU_div +
> > GPU_to_CPU_offset;
> >
>
> TIMESTAMP_OFFSET should indeed be set by the kernel (on resume). But I
> don't think we need to post M/D+offset to userspace. The 2 Frequencies +
> the scalar offset are the raw sources, and userspace can work back from
> there.
Sure. No matter how you express the relationship, my point was, if the
calibration is supposed to happen in the kernel at resume time,
returning both the CPU/GPU time in DEV_QUERY_TIMESTAMP to make sure the
sampling is close enough that they actually represent the same
timestamp might not be needed, because you can easily convert from one
domain to the other.
Powered by blists - more mailing lists