@@ -306,3 +306,17 @@ unsigned int intel_engines_has_context_isolation(struct drm_i915_private *i915)
return which;
}
+
+bool engines_context_isolated(struct drm_i915_private *i915)
+{
+ struct intel_engine_cs *engine;
+
+ if (!DRIVER_CAPS(i915)->has_logical_contexts)
+ return false;
+
+ for_each_uabi_engine(engine, i915)
+ if (!engine->default_state)
+ return false;
+
+ return true;
+}
@@ -15,6 +15,7 @@ struct intel_engine_cs *
intel_engine_lookup_user(struct drm_i915_private *i915, u8 class, u8 instance);
unsigned int intel_engines_has_context_isolation(struct drm_i915_private *i915);
+bool engines_context_isolated(struct drm_i915_private *i915);
void intel_engine_add_user(struct intel_engine_cs *engine);
void intel_engines_driver_register(struct drm_i915_private *i915);
@@ -145,7 +145,7 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,
value = 1;
break;
case I915_PARAM_HAS_CONTEXT_ISOLATION:
- value = intel_engines_has_context_isolation(i915);
+ value = engines_context_isolated(i915);
break;
case I915_PARAM_SLICE_MASK:
/* Not supported from Xe_HP onward; use topology queries */
In a previous commit, the uAPI documentation for this param was updated to reflect the actual usage expected by Iris. Now make sure the driver does indeed return a boolean value rather than an engine bitmask. Signed-off-by: Adrian Larumbe <adrian.larumbe@collabora.com> --- drivers/gpu/drm/i915/gt/intel_engine_user.c | 14 ++++++++++++++ drivers/gpu/drm/i915/gt/intel_engine_user.h | 1 + drivers/gpu/drm/i915/i915_getparam.c | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-)