[Mesa-dev] [PATCH] i965: Allow a per gen timebase scale factor

Kenneth Graunke kenneth at whitecape.org
Fri Jan 6 21:28:46 UTC 2017


On Friday, January 6, 2017 1:17:39 PM PST Kenneth Graunke wrote:
> From: Robert Bragg <robert at sixbynine.org>
> 
> v2: (Ken) Update timebase_scale for platforms past Skylake/Broxton too.

Hi Robert!

Your patch had merge conflicts in gen_device_info.c at this point, so I
fixed those and re-sent it.  It also looked like it didn't set
timebase_scale for KBL, GLK, etc...it should now (via GEN9_FEATURES and
GEN9_LP_FEATURES).

[snip]

> +/* As best we know currently, the Gen HW timestamps are 36bits across
> + * all platforms, which we need to account for when calculating a
> + * delta to measure elapsed time.
> + *
> + * The timestamps read via glGetTimestamp() / brw_get_timestamp() sometimes
> + * only have 32bits due to a kernel bug and so in that case we make sure to
> + * treat all raw timestamps as 32bits so they overflow consistently and remain
> + * comparable.
> + */
> +uint64_t
> +brw_raw_timestamp_delta(struct brw_context *brw, uint64_t time0, uint64_t time1)
> +{
> +   if (brw->screen->hw_has_timestamp == 2) {
> +      /* Kernel clips timestamps to 32bits in this case */
> +      return (uint32_t)time1 - (uint32_t)time0;

Is this right?  intel_detect_timestamp() says

         return 2; /* upper dword holds the low 32bits of the timestamp */

but casting these to uint32_t should take the low DWords...

> +   } else {
> +      if (time0 > time1)
> +         return (1ULL << 36) + time1 - time0;
> +      else
> +         return time1 - time0;
> +   }
> +}

Otherwise, this looks good to me, and is:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

Could you try and hook up your fixed-point multiplier to fix query
buffer objects as well?  I'd like to land these for the 17.0 release.

Thanks for fixing this!

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170106/0dca743a/attachment.sig>


More information about the mesa-dev mailing list