Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Pottumuttu, Sai Teja" <sai.teja.pottumuttu@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>,
	Szymon Morek <szymon.morek@intel.com>,
	<sai.teja.pottumuttu@intel.com>
Subject: Re: [PATCH 2/3] drm/xe/query: Move timestamp reg to hwe_read_timestamp()
Date: Thu, 10 Oct 2024 15:33:30 +0530	[thread overview]
Message-ID: <88778cd7-c165-41bd-b892-e9f8e3dde8b5@intel.com> (raw)
In-Reply-To: <20241010034847.389734-2-lucas.demarchi@intel.com>


On 10-10-2024 09:18, Lucas De Marchi wrote:
> __read_timestamps() is actually reading the timestamp from a certain
> hwe. Use it as parameter, move register declarations to be inside that
> function and rename it.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_query.c | 22 +++++++---------------
>   1 file changed, 7 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
> index a1f4cc25bea68..d86959076b078 100644
> --- a/drivers/gpu/drm/xe/xe_query.c
> +++ b/drivers/gpu/drm/xe/xe_query.c
> @@ -85,16 +85,13 @@ static __ktime_func_t __clock_id_to_func(clockid_t clk_id)
>   }
>   
>   static void
> -__read_timestamps(struct xe_gt *gt,
> -		  struct xe_reg lower_reg,
> -		  struct xe_reg upper_reg,
> -		  u64 *engine_ts,
> -		  u64 *cpu_ts,
> -		  u64 *cpu_delta,
> -		  __ktime_func_t cpu_clock)
> +hwe_read_timestamp(struct xe_hw_engine *hwe, u64 *engine_ts, u64 *cpu_ts,

Nit: Probably the function name should be hwe_read_timestamps (s at 
last), just like the previous name and also as its reads multiple 
timestamps I believe.

With that LGTM,

Reviewed-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>

> +		   u64 *cpu_delta, __ktime_func_t cpu_clock)
>   {
> -	struct xe_mmio *mmio = &gt->mmio;
> +	struct xe_mmio *mmio = &hwe->gt->mmio;
>   	u32 upper, lower, old_upper, loop = 0;
> +	struct xe_reg upper_reg = RING_TIMESTAMP_UDW(hwe->mmio_base),
> +		      lower_reg = RING_TIMESTAMP(hwe->mmio_base);
>   
>   	upper = xe_mmio_read32(mmio, upper_reg);
>   	do {
> @@ -155,13 +152,8 @@ query_engine_cycles(struct xe_device *xe,
>   	if (xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL))
>   		return -EIO;
>   
> -	__read_timestamps(gt,
> -			  RING_TIMESTAMP(hwe->mmio_base),
> -			  RING_TIMESTAMP_UDW(hwe->mmio_base),
> -			  &resp.engine_cycles,
> -			  &resp.cpu_timestamp,
> -			  &resp.cpu_delta,
> -			  cpu_clock);
> +	hwe_read_timestamp(hwe, &resp.engine_cycles, &resp.cpu_timestamp,
> +			   &resp.cpu_delta, cpu_clock);
>   
>   	xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
>   

  reply	other threads:[~2024-10-10 10:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10  3:48 [PATCH 1/3] drm/xe/query: Increase timestamp width Lucas De Marchi
2024-10-10  3:48 ` [PATCH 2/3] drm/xe/query: Move timestamp reg to hwe_read_timestamp() Lucas De Marchi
2024-10-10 10:03   ` Pottumuttu, Sai Teja [this message]
2024-10-10 13:24     ` Lucas De Marchi
2024-10-10 13:31       ` Pottumuttu, Sai Teja
2024-10-10  3:48 ` [PATCH 3/3] drm/xe/query: Tidy up error EFAULT returns Lucas De Marchi
2024-10-10  9:39   ` Pottumuttu, Sai Teja
2024-10-10  3:54 ` ✓ CI.Patch_applied: success for series starting with [1/3] drm/xe/query: Increase timestamp width Patchwork
2024-10-10  3:54 ` ✓ CI.checkpatch: " Patchwork
2024-10-10  3:56 ` ✓ CI.KUnit: " Patchwork
2024-10-10  4:07 ` ✓ CI.Build: " Patchwork
2024-10-10  4:08 ` [PATCH 1/3] " Lucas De Marchi
2024-10-10 17:10   ` Matt Roper
2024-10-10 18:28     ` Lucas De Marchi
2024-10-10 21:34       ` Matt Roper
2024-10-10  4:09 ` ✓ CI.Hooks: success for series starting with [1/3] " Patchwork
2024-10-10  4:11 ` ✓ CI.checksparse: " Patchwork
2024-10-10  4:30 ` ✗ CI.BAT: failure " Patchwork
2024-10-10 17:39 ` ✗ CI.FULL: " 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=88778cd7-c165-41bd-b892-e9f8e3dde8b5@intel.com \
    --to=sai.teja.pottumuttu@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=szymon.morek@intel.com \
    --cc=umesh.nerlige.ramappa@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