]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915/perf: Replace global wakeref tracking with engine-pm
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 11 Oct 2019 19:03:17 +0000 (20:03 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 12 Oct 2019 06:53:20 +0000 (07:53 +0100)
As we now have a specific engine to use OA on, exchange the top-level
runtime-pm wakeref with the engine-pm. This still results in the same
top-level runtime-pm, but with more nuances to keep the engine and its
gt awake.

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

index 77c3cef645483887cb9ca9288032d07a64d81087..c4a436dfb7dbf9e249b36f96ea0dcd049b66d2a9 100644 (file)
 #include <linux/uuid.h>
 
 #include "gem/i915_gem_context.h"
-#include "gem/i915_gem_pm.h"
+#include "gt/intel_engine_pm.h"
 #include "gt/intel_engine_user.h"
 #include "gt/intel_lrc_reg.h"
 
@@ -1353,7 +1353,7 @@ static void i915_oa_stream_destroy(struct i915_perf_stream *stream)
        free_oa_buffer(stream);
 
        intel_uncore_forcewake_put(stream->uncore, FORCEWAKE_ALL);
-       intel_runtime_pm_put(stream->uncore->rpm, stream->wakeref);
+       intel_engine_pm_put(stream->engine);
 
        if (stream->ctx)
                oa_put_render_ctx_id(stream);
@@ -2218,7 +2218,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
         *   In our case we are expecting that taking pm + FORCEWAKE
         *   references will effectively disable RC6.
         */
-       stream->wakeref = intel_runtime_pm_get(stream->uncore->rpm);
+       intel_engine_pm_get(stream->engine);
        intel_uncore_forcewake_get(stream->uncore, FORCEWAKE_ALL);
 
        ret = alloc_oa_buffer(stream);
@@ -2252,7 +2252,7 @@ err_oa_buf_alloc:
        put_oa_config(stream->oa_config);
 
        intel_uncore_forcewake_put(stream->uncore, FORCEWAKE_ALL);
-       intel_runtime_pm_put(stream->uncore->rpm, stream->wakeref);
+       intel_engine_pm_put(stream->engine);
 
 err_config:
        if (stream->ctx)
index a91ae2d1a5433f482268d6feea491e2465b49be0..eb8d1ebd50955d344606ba265d5304d8b3f91dde 100644 (file)
@@ -134,12 +134,6 @@ struct i915_perf_stream {
         */
        struct intel_uncore *uncore;
 
-       /**
-        * @wakeref: As we keep the device awake while the perf stream is
-        * active, we track our runtime pm reference for later release.
-        */
-       intel_wakeref_t wakeref;
-
        /**
         * @engine: Engine associated with this performance stream.
         */