mesa/src/intel/common
Robert Bragg 344d1a4015 i965: Allow a per gen timebase scale factor
Prior to Skylake the Gen HW timestamps were driven by a 12.5MHz clock
with the convenient property of being able to scale by an integer (80)
to nanosecond units.

For Skylake the frequency is 12MHz or a scale factor of 83.333333

This updates gen_device_info to track a floating point timebase_scale
factor and makes corresponding _queryobj.c changes to no longer assume a
scale factor of 80 works across all gens.

Although the gen6_ code could have been been left alone, the changes
keep the code more comparable, and it now shares a few utility functions
for scaling raw timestamps and calculating deltas. The utility for
calculating deltas takes into account 32 or 36bit overflow depending on
the current kernel version.

Note: this leaves the timestamp handling of ARB_query_buffer_object
untouched, which continues to use an incorrect scale of 80 on Skylake
for now. This is more awkward to solve since the scaling is currently
done using a very limited uint64 ALU available to the command parser
that doesn't support multiply or divide where it's already taking a
large number of instructions just to effectively multiple by 80.

This fixes piglit arb_timer_query-timestamp-get on Skylake

v2: (Ken) Update timebase_scale for platforms past Skylake/Broxton too.

Signed-off-by: Robert Bragg <robert@sixbynine.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-03-17 15:45:19 +00:00
..
gen_debug.c intel/debug: Add a common INTEL_DEBUG=nohiz option 2017-03-14 21:00:09 -07:00
gen_debug.h intel/debug: Add a common INTEL_DEBUG=nohiz option 2017-03-14 21:00:09 -07:00
gen_device_info.c i965: Allow a per gen timebase scale factor 2017-03-17 15:45:19 +00:00
gen_device_info.h i965: Allow a per gen timebase scale factor 2017-03-17 15:45:19 +00:00
gen_l3_config.c i965/l3: Add explicit way size calculation for bxt 2016-10-05 07:57:58 -07:00
gen_l3_config.h intel: Share URB configuration code between GL and Vulkan. 2016-11-19 11:40:01 -08:00
gen_sample_positions.h intel/common: use correct header guards 2016-10-14 11:53:37 +01:00
gen_urb_config.c i965: Fix a mistake from porting the URB allocation code to arrays. 2016-11-23 16:57:29 -08:00