From: Mihail Atanassov <mihail.atanassov@arm.com>
To: Mary Guillemard <mary.guillemard@collabora.com>
Cc: linux-kernel@vger.kernel.org, kernel@collabora.com,
Christopher Healy <healych@amazon.com>,
Boris Brezillon <boris.brezillon@collabora.com>,
Steven Price <steven.price@arm.com>,
Liviu Dudau <liviu.dudau@arm.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
dri-devel@lists.freedesktop.org, nd@arm.com
Subject: Re: [PATCH v3] drm/panthor: Add DEV_QUERY_TIMESTAMP_INFO dev query
Date: Wed, 28 Aug 2024 11:09:09 +0100 [thread overview]
Message-ID: <ee2c315c-b15b-4ac7-8cea-c331a60a3374@arm.com> (raw)
In-Reply-To: <Zs7d2-NHTy-A_oLL@kuroko.kudu-justice.ts.net>
Hi Mary,
On 28/08/2024 09:24, Mary Guillemard wrote:
> Hi Mihail,
>
> On Mon, Aug 19, 2024 at 03:25:48PM +0100, Mihail Atanassov wrote:
>>> diff --git a/include/uapi/drm/panthor_drm.h b/include/uapi/drm/panthor_drm.h
>>> index 926b1deb1116..944f5618aa05 100644
>>> --- a/include/uapi/drm/panthor_drm.h
>>> +++ b/include/uapi/drm/panthor_drm.h
>>> @@ -260,6 +260,9 @@ enum drm_panthor_dev_query_type {
>>> /** @DRM_PANTHOR_DEV_QUERY_CSIF_INFO: Query command-stream interface information. */
>>> DRM_PANTHOR_DEV_QUERY_CSIF_INFO,
>>> +
>>> + /** @DRM_PANTHOR_DEV_QUERY_TIMESTAMP_INFO: Query timestamp information. */
>>> + DRM_PANTHOR_DEV_QUERY_TIMESTAMP_INFO,
>>> };
>>> /**
>>> @@ -377,6 +380,22 @@ struct drm_panthor_csif_info {
>>> __u32 pad;
>>> };
>>> +/**
>>> + * 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. */
Sorry, late nitpick here, maybe add "or 0 if unknown" or something similar?
>>> + __u64 timestamp_frequency;
>>> +
>>> + /** @current_timestamp: The current timestamp. */
>>> + __u64 current_timestamp;
>>> +
>>> + /** @timestamp_offset: The offset of the timestamp timer. */
>>> + __u64 timestamp_offset;
>>
>> Are you sure you don't want the cntvct_el0 and cntfrq_el0 values here, too,
>> as separate fields? While they're not values coming from the GPU, they are
>> related. Getting the lowest delta possible between querying one timestamp
>> register and the other is quite useful for tooling. Requiring userspace to
>> do two separate queries, one for CPU time and one for GPU time, doesn't feel
>> optimal, your max deviation will necessarily be higher that way.
>>
>
> Exposing arch dependent values in the uapi feels wrong to me too but
> maybe that could be done with just the cpu timestamp with a frequency of
> 1 on other platform if needed?
>
> In any cases, I think that if we ever need it we can extend this query
> with more values. (as we are retrocompatible thanks to PANTHOR_UOBJ_SET)
Agreed, we can leave that for later.
>
> --
> Mary
>
>
Do you have a link you can share with the userspace side of things?
Assuming userland has been reviewed and is ready for merging, and the
small nitpick above fixed,
Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com>
--
Mihail Atanassov <mihail.atanassov@arm.com>
next prev parent reply other threads:[~2024-08-28 10:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 11:25 [PATCH v3] drm/panthor: Add DEV_QUERY_TIMESTAMP_INFO dev query Mary Guillemard
2024-08-19 14:25 ` Mihail Atanassov
2024-08-28 8:24 ` Mary Guillemard
2024-08-28 10:09 ` Mihail Atanassov [this message]
2024-08-29 9:16 ` Mary Guillemard
2024-08-20 9:56 ` Heiko Stübner
2024-08-28 11:30 ` Boris Brezillon
2024-08-28 11:50 ` Mihail Atanassov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ee2c315c-b15b-4ac7-8cea-c331a60a3374@arm.com \
--to=mihail.atanassov@arm.com \
--cc=airlied@gmail.com \
--cc=boris.brezillon@collabora.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=healych@amazon.com \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mary.guillemard@collabora.com \
--cc=mripard@kernel.org \
--cc=nd@arm.com \
--cc=steven.price@arm.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox