drm/i915: expose command stream timestamp frequency to userspace
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 10 Nov 2017 19:08:44 +0000 (19:08 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 13 Nov 2017 15:59:30 +0000 (15:59 +0000)
commitdab91783338bd3dd42638f89b5f7e34c57773207
tree4da6049f29ac87cf4fa566ece0f7163be29ed52f
parent95690a02fb5d963e62aa16c3796af3dde01f63c9
drm/i915: expose command stream timestamp frequency to userspace

We use to have this fixed per generation, but starting with CNL userspace
cannot tell just off the PCI ID. Let's make this information available. This
is particularly useful for performance monitoring where much of the
normalization work is done using those timestamps (this include pipeline
statistics in both GL & Vulkan as well as OA reports).

v2: Use variables for 24MHz/19.2MHz values (Ewelina)
    Renamed function & coding style (Sagar)

v3: Fix frequency read on Broadwell (Sagar)
    Fix missing divide by 4 on <= gen4 (Sagar)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171110190845.32574-7-lionel.g.landwerlin@intel.com
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_device_info.c
include/uapi/drm/i915_drm.h