[PATCH 6/6] I915_CONTEXT_CREATE_FLAGS_ULLS

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Tue Jan 12 17:22:20 UTC 2021


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_context.c       | 11 ++++++++---
 drivers/gpu/drm/i915/gem/i915_gem_context.h       | 15 +++++++++++++++
 drivers/gpu/drm/i915/gem/i915_gem_context_types.h |  1 +
 include/uapi/drm/i915_drm.h                       |  3 ++-
 4 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index ec415172bb00..0c6936235bd3 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -861,9 +861,14 @@ i915_gem_create_context(struct drm_i915_private *i915, unsigned int flags)
 		intel_timeline_put(timeline);
 	}
 
-	/* Default expiry for user fences. */
-	ctx->watchdog.timeout_us = CONFIG_DRM_I915_REQUEST_TIMEOUT *
-				   NSEC_PER_MSEC / NSEC_PER_USEC;
+	if (flags & I915_CONTEXT_CREATE_FLAGS_ULLS)
+		i915_gem_context_set_ulls(ctx); /* TODO make it depend on something? */
+
+	if (!i915_gem_context_is_ulls(ctx)) {
+		/* Default expiry for user fences. */
+		ctx->watchdog.timeout_us = CONFIG_DRM_I915_REQUEST_TIMEOUT *
+					   NSEC_PER_MSEC / NSEC_PER_USEC;
+	}
 
 	trace_i915_context_create(ctx);
 
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.h b/drivers/gpu/drm/i915/gem/i915_gem_context.h
index b5c908f3f4f2..6b2043d7f40f 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.h
@@ -90,6 +90,21 @@ static inline void i915_gem_context_clear_persistence(struct i915_gem_context *c
 	clear_bit(UCONTEXT_PERSISTENCE, &ctx->user_flags);
 }
 
+static inline bool i915_gem_context_is_ulls(const struct i915_gem_context *ctx)
+{
+	return test_bit(UCONTEXT_ULLS, &ctx->user_flags);
+}
+
+static inline void i915_gem_context_set_ulls(struct i915_gem_context *ctx)
+{
+	set_bit(UCONTEXT_ULLS, &ctx->user_flags);
+}
+
+static inline void i915_gem_context_clear_ulls(struct i915_gem_context *ctx)
+{
+	clear_bit(UCONTEXT_ULLS, &ctx->user_flags);
+}
+
 static inline bool
 i915_gem_context_user_engines(const struct i915_gem_context *ctx)
 {
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context_types.h b/drivers/gpu/drm/i915/gem/i915_gem_context_types.h
index 340473aa70de..0bff98e2c2ec 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context_types.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context_types.h
@@ -134,6 +134,7 @@ struct i915_gem_context {
 #define UCONTEXT_BANNABLE		2
 #define UCONTEXT_RECOVERABLE		3
 #define UCONTEXT_PERSISTENCE		4
+#define UCONTEXT_ULLS			5
 
 	/**
 	 * @flags: small set of booleans
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index a4c65780850c..400dc9fec71e 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -1580,8 +1580,9 @@ struct drm_i915_gem_context_create_ext {
 	__u32 flags;
 #define I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS	(1u << 0)
 #define I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE	(1u << 1)
+#define I915_CONTEXT_CREATE_FLAGS_ULLS			(1u << 2)
 #define I915_CONTEXT_CREATE_FLAGS_UNKNOWN \
-	(-(I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE << 1))
+	(-(I915_CONTEXT_CREATE_FLAGS_ULLS << 1))
 	__u64 extensions;
 };
 
-- 
2.27.0



More information about the Intel-gfx-trybot mailing list