[PATCH v2 1/3] drm/xe/query: Increase timestamp width

Matt Roper matthew.d.roper at intel.com
Fri Oct 11 21:09:49 UTC 2024


On Thu, Oct 10, 2024 at 08:56:16PM -0700, Lucas De Marchi wrote:
> Starting with Xe2 the timestamp is a full 64 bit counter, contrary to
> the 36 bit that was available before. Although 36 should be sufficient
> for any reasonable delta calculation (for Xe2, of about 30min), it's
> surprising to userspace to get something truncated. Also if the
> timestamp being compared to is coming from the GPU and the application
> is not careful enough to apply the width there, a delta calculation
> would be wrong.
> 
> Extend it to full 64-bits starting with Xe2.
> 
> v2: Expand width=64 to media gt, as it's just a wrong tagging in the
> spec - empirical tests show it goes beyond 36 bits and match the engines
> for the main gt
> 
> Bspec: 60411
> Cc: Szymon Morek <szymon.morek at intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>

Reviewed-by: Matt Roper <matthew.d.roper at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_query.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
> index 158629971eab3..07093af0b32e3 100644
> --- a/drivers/gpu/drm/xe/xe_query.c
> +++ b/drivers/gpu/drm/xe/xe_query.c
> @@ -164,7 +164,11 @@ query_engine_cycles(struct xe_device *xe,
>  			  cpu_clock);
>  
>  	xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
> -	resp.width = 36;
> +
> +	if (GRAPHICS_VER(xe) >= 20)
> +		resp.width = 64;
> +	else
> +		resp.width = 36;
>  
>  	/* Only write to the output fields of user query */
>  	if (put_user(resp.cpu_timestamp, &query_ptr->cpu_timestamp))
> -- 
> 2.46.2
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the Intel-xe mailing list