[Intel-gfx] [RFC 15/17] drm/i915: Migrate client to new owner on context create
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Wed Oct 19 17:32:52 UTC 2022
From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Some usage models pass a drm file descriptor from a creating process to
the client which will actually use it.
Use the core drm helper on GEM context create to account for this and
ensure client's resource usage is tracked in the correct cgroup.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_context.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index 1e29b1e6d186..5f6af306e147 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -69,6 +69,7 @@
#include <linux/nospec.h>
#include <drm/drm_cache.h>
+#include <drm/drm_clients.h>
#include <drm/drm_syncobj.h>
#include "gt/gen6_ppgtt.h"
@@ -2300,6 +2301,8 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
args->ctx_id = id;
drm_dbg(&i915->drm, "HW context %d created\n", args->ctx_id);
+ drm_clients_migrate(file);
+
return 0;
err_pc:
--
2.34.1
More information about the Intel-gfx
mailing list