drm/i915/perf: allow for CS OA configs to be created lazily
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Sat, 12 Oct 2019 07:23:06 +0000 (08:23 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 12 Oct 2019 08:08:27 +0000 (09:08 +0100)
commit6a45008ab7bb5e13b543de0c141b94aaa71d8397
tree15b89fcf32e8284869a55e6d7346b5c3543aaeb3
parentc3eb54aad982d05493ab374a6f0d0a6831dd2c6e
drm/i915/perf: allow for CS OA configs to be created lazily

Here we introduce a mechanism by which the execbuf part of the i915
driver will be able to request that a batch buffer containing the
programming for a particular OA config be created.

We'll execute these OA configuration buffers right before executing a
set of userspace commands so that a particular user batchbuffer be
executed with a given OA configuration.

This mechanism essentially allows the userspace driver to go through
several OA configuration without having to open/close the i915/perf
stream.

v2: No need for locking on object OA config object creation (Chris)
    Flush cpu mapping of OA config (Chris)

v3: Properly deal with the perf_metric lock (Chris/Lionel)

v4: Fix oa config unref/put when not found (Lionel)

v5: Allocate BOs for configurations on the stream instead of globally
    (Lionel)

v6: Fix 64bit division (Chris)

v7: Store allocated config BOs into the stream (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20191012072308.30312-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_gpu_commands.h
drivers/gpu/drm/i915/i915_perf.c
drivers/gpu/drm/i915/i915_perf.h
drivers/gpu/drm/i915/i915_perf_types.h