From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: "Cavitt, Jonathan" <jonathan.cavitt@intel.com>,
"Brost, Matthew" <matthew.brost@intel.com>,
"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v5 05/10] drm/xe: Add xe_gt_clock_interval_to_ms helper
Date: Wed, 12 Jun 2024 17:39:02 +0530 [thread overview]
Message-ID: <89b9ca9b-c1d4-4d77-a616-41c1d22a058f@intel.com> (raw)
In-Reply-To: <CH0PR11MB5444CA0A965A6A39F47CA498E5C62@CH0PR11MB5444.namprd11.prod.outlook.com>
On 10-06-2024 22:04, Cavitt, Jonathan wrote:
> -----Original Message-----
> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Matthew Brost
> Sent: Monday, June 10, 2024 7:18 AM
> To: intel-xe@lists.freedesktop.org
> Subject: [PATCH v5 05/10] drm/xe: Add xe_gt_clock_interval_to_ms helper
>>
>> Add helper to convert GT clock ticks to msec. Useful for determining if
>> timeouts occur by examing GT clock ticks.
>>
>> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_gt_clock.c | 18 ++++++++++++++++++
>> drivers/gpu/drm/xe/xe_gt_clock.h | 1 +
>> 2 files changed, 19 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_gt_clock.c b/drivers/gpu/drm/xe/xe_gt_clock.c
>> index 9ff2061133df..a9392a743fd5 100644
>> --- a/drivers/gpu/drm/xe/xe_gt_clock.c
>> +++ b/drivers/gpu/drm/xe/xe_gt_clock.c
>> @@ -79,3 +79,21 @@ int xe_gt_clock_init(struct xe_gt *gt)
>> gt->info.reference_clock = freq;
>> return 0;
>> }
>> +
>> +static u64 div_u64_roundup(u64 nom, u32 den)
>
> Nit: I think this should be "num" for "numerator" instead of "nom".
> Or maybe just:
> static u64 div_u64_roundup(u64 n, u64 d)
> If "num" for numerator would be confused for "num" as in "number".
>
> Otherwise:
> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> -Jonathan Cavitt
>
>> +{
>> + return div_u64(nom + den - 1, den);
>> +}
>> +
>> +/**
>> + * xe_gt_clock_interval_to_ms - Convert sampled GT clock ticks to msec
>> + *
>> + * @gt: the &xe_gt
>> + * @count: count of GT clock ticks
>> + *
>> + * Returns: time in msec
>> + */
>> +u64 xe_gt_clock_interval_to_ms(struct xe_gt *gt, u64 count)
>> +{
>> + return div_u64_roundup(count * MSEC_PER_SEC, gt->info.reference_clock);
DIV_ROUND_CLOSEST_ULL can be used here.
>> +}
>> diff --git a/drivers/gpu/drm/xe/xe_gt_clock.h b/drivers/gpu/drm/xe/xe_gt_clock.h
>> index 44fa0371b973..3adeb7baaca4 100644
>> --- a/drivers/gpu/drm/xe/xe_gt_clock.h
>> +++ b/drivers/gpu/drm/xe/xe_gt_clock.h
>> @@ -11,5 +11,6 @@
>> struct xe_gt;
>>
>> int xe_gt_clock_init(struct xe_gt *gt);
>> +u64 xe_gt_clock_interval_to_ms(struct xe_gt *gt, u64 count);
>>
>> #endif
>> --
>> 2.34.1
>>
>>
next prev parent reply other threads:[~2024-06-12 12:09 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 14:18 [PATCH v5 00/10] Only timeout jobs if they run longer than timeout period Matthew Brost
2024-06-10 14:18 ` [PATCH v5 01/10] drm/xe: Add LRC ctx timestamp support functions Matthew Brost
2024-06-10 17:32 ` Cavitt, Jonathan
2024-06-10 14:18 ` [PATCH v5 02/10] drm/xe: Add MI_COPY_MEM_MEM GPU instruction definitions Matthew Brost
2024-06-10 16:39 ` Cavitt, Jonathan
2024-06-10 14:18 ` [PATCH v5 03/10] drm/xe: Emit ctx timestamp copy in ring ops Matthew Brost
2024-06-10 14:44 ` Cavitt, Jonathan
2024-06-10 14:18 ` [PATCH v5 04/10] drm/xe: Add ctx timestamp to LRC snapshot Matthew Brost
2024-06-10 16:40 ` Cavitt, Jonathan
2024-06-10 14:18 ` [PATCH v5 05/10] drm/xe: Add xe_gt_clock_interval_to_ms helper Matthew Brost
2024-06-10 16:34 ` Cavitt, Jonathan
2024-06-12 12:09 ` Ghimiray, Himal Prasad [this message]
2024-06-10 14:18 ` [PATCH v5 06/10] drm/xe: Improve unexpected state error messages Matthew Brost
2024-06-10 16:36 ` Cavitt, Jonathan
2024-06-10 16:45 ` Michal Wajdeczko
2024-06-10 17:09 ` Matthew Brost
2024-06-11 0:09 ` John Harrison
2024-06-11 1:43 ` Matthew Brost
2024-06-10 14:18 ` [PATCH v5 07/10] drm/xe: Add GuC state asserts to deregister_exec_queue Matthew Brost
2024-06-10 17:12 ` Cavitt, Jonathan
2024-06-10 14:18 ` [PATCH v5 08/10] drm/xe: Add pending disable assert to handle_sched_done Matthew Brost
2024-06-10 16:35 ` Cavitt, Jonathan
2024-06-10 14:18 ` [PATCH v5 09/10] drm/xe: Add killed, banned, or wedged as stick bit during GuC reset Matthew Brost
2024-06-10 16:35 ` Cavitt, Jonathan
2024-06-10 14:18 ` [PATCH v5 10/10] drm/xe: Sample ctx timestamp to determine if jobs have timed out Matthew Brost
2024-06-10 19:32 ` Cavitt, Jonathan
2024-06-10 20:12 ` Matthew Brost
2024-06-11 0:36 ` John Harrison
2024-06-11 1:35 ` Matthew Brost
2024-06-12 4:21 ` Zbigniew Kempczyński
2024-06-10 14:23 ` ✓ CI.Patch_applied: success for Only timeout jobs if they run longer than timeout period Patchwork
2024-06-10 14:23 ` ✗ CI.checkpatch: warning " Patchwork
2024-06-10 14:24 ` ✓ CI.KUnit: success " Patchwork
2024-06-10 14:36 ` ✓ CI.Build: " Patchwork
2024-06-10 14:38 ` ✗ CI.Hooks: failure " Patchwork
2024-06-10 14:39 ` ✓ CI.checksparse: success " Patchwork
2024-06-10 15:16 ` ✓ CI.BAT: " Patchwork
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=89b9ca9b-c1d4-4d77-a616-41c1d22a058f@intel.com \
--to=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jonathan.cavitt@intel.com \
--cc=matthew.brost@intel.com \
/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