summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_drm_client.h
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>2022-04-01 15:22:00 +0100
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2022-04-05 08:39:03 +0100
commit8399eec8a127c5bf70e93220421e12d9f7b2b3df (patch)
treeb58c807385df6f67c8f94b28ac043294b4872ba1 /drivers/gpu/drm/i915/i915_drm_client.h
parent43c504607dc3e5e38b6afa76badebb6686e2cf05 (diff)
drm/i915: Track runtime spent in closed and unreachable GEM contexts
As contexts are abandoned we want to remember how much GPU time they used (per class) so later we can used it for smarter purposes. As GEM contexts are closed we want to have the DRM client remember how much GPU time they used (per class) so later we can used it for smarter purposes. v2: * Size past runtimes array by uabi class, not internal. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Aravind Iddamsetty <aravind.iddamsetty@intel.com> # v1 Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> # v1 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220401142205.3123159-4-tvrtko.ursulin@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drm_client.h')
-rw-r--r--drivers/gpu/drm/i915/i915_drm_client.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drm_client.h b/drivers/gpu/drm/i915/i915_drm_client.h
index e8986ad51176..cbc3161ab021 100644
--- a/drivers/gpu/drm/i915/i915_drm_client.h
+++ b/drivers/gpu/drm/i915/i915_drm_client.h
@@ -9,6 +9,10 @@
#include <linux/kref.h>
#include <linux/xarray.h>
+#include "gt/intel_engine_types.h"
+
+#define I915_LAST_UABI_ENGINE_CLASS I915_ENGINE_CLASS_VIDEO_ENHANCE
+
struct drm_i915_private;
struct i915_drm_clients {
@@ -24,6 +28,11 @@ struct i915_drm_client {
unsigned int id;
struct i915_drm_clients *clients;
+
+ /**
+ * @past_runtime: Accumulation of pphwsp runtimes from closed contexts.
+ */
+ atomic64_t past_runtime[I915_LAST_UABI_ENGINE_CLASS + 1];
};
void i915_drm_clients_init(struct i915_drm_clients *clients,