drm/i915: Enable i915 perf stream for Haswell OA unit
authorRobert Bragg <robert@sixbynine.org>
Mon, 7 Nov 2016 19:49:52 +0000 (19:49 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 22 Nov 2016 13:38:13 +0000 (14:38 +0100)
commitd79651522e89c4ffa8992b48dfe449f0c583f809
tree6495a5c3429bc98ca346756f9ae0c98492ce7b48
parent8a3003dd93e2db2e7c8edc316e2978f750ca0dc2
drm/i915: Enable i915 perf stream for Haswell OA unit

Gen graphics hardware can be set up to periodically write snapshots of
performance counters into a circular buffer via its Observation
Architecture and this patch exposes that capability to userspace via the
i915 perf interface.

v2:
   Make sure to initialize ->specific_ctx_id when opening, without
   relying on _pin_notify hook, in case ctx already pinned.
v3:
   Revert back to pinning ctx upfront when opening stream, removing
   need to hook in to pinning and to update OACONTROL on the fly.

Signed-off-by: Robert Bragg <robert@sixbynine.org>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Sourab Gupta <sourab.gupta@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161107194957.3385-7-robert@sixbynine.org
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_perf.c
drivers/gpu/drm/i915/i915_reg.h
include/uapi/drm/i915_drm.h