Skip to content

Commit 07bcfd1

Browse files
committed
drm/i915/gen12: Disable preemption timeout
Allow super long OpenCL workloads which cannot be preempted within the default timeout to run out of the box. v2: * Make it stick out more and apply only to RCS. (Chris) v3: * Mention platform override in kconfig. (Joonas) Signed-off-by: Tvrtko Ursulin <[email protected]> Cc: Chris Wilson <[email protected]> Cc: Joonas Lahtinen <[email protected]> Cc: Michal Mrozek <[email protected]> Cc: <[email protected]> # v5.6+ Acked-by: Chris Wilson <[email protected]> Acked-by: Michal Mrozek <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 70c96e3 commit 07bcfd1

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

drivers/gpu/drm/i915/Kconfig.profile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ config DRM_I915_PREEMPT_TIMEOUT
4141

4242
May be 0 to disable the timeout.
4343

44+
The compiled in default may get overridden at driver probe time on
45+
certain platforms and certain engines which will be reflected in the
46+
sysfs control.
47+
4448
config DRM_I915_MAX_REQUEST_BUSYWAIT
4549
int "Busywait for request completion limit (ns)"
4650
default 8000 # nanoseconds

drivers/gpu/drm/i915/gt/intel_engine_cs.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ static void intel_engine_sanitize_mmio(struct intel_engine_cs *engine)
275275
static int intel_engine_setup(struct intel_gt *gt, enum intel_engine_id id)
276276
{
277277
const struct engine_info *info = &intel_engines[id];
278+
struct drm_i915_private *i915 = gt->i915;
278279
struct intel_engine_cs *engine;
279280

280281
BUILD_BUG_ON(MAX_ENGINE_CLASS >= BIT(GEN11_ENGINE_CLASS_WIDTH));
@@ -301,11 +302,11 @@ static int intel_engine_setup(struct intel_gt *gt, enum intel_engine_id id)
301302
engine->id = id;
302303
engine->legacy_idx = INVALID_ENGINE;
303304
engine->mask = BIT(id);
304-
engine->i915 = gt->i915;
305+
engine->i915 = i915;
305306
engine->gt = gt;
306307
engine->uncore = gt->uncore;
307308
engine->hw_id = engine->guc_id = info->hw_id;
308-
engine->mmio_base = __engine_mmio_base(gt->i915, info->mmio_bases);
309+
engine->mmio_base = __engine_mmio_base(i915, info->mmio_bases);
309310

310311
engine->class = info->class;
311312
engine->instance = info->instance;
@@ -322,11 +323,15 @@ static int intel_engine_setup(struct intel_gt *gt, enum intel_engine_id id)
322323
engine->props.timeslice_duration_ms =
323324
CONFIG_DRM_I915_TIMESLICE_DURATION;
324325

326+
/* Override to uninterruptible for OpenCL workloads. */
327+
if (INTEL_GEN(i915) == 12 && engine->class == RENDER_CLASS)
328+
engine->props.preempt_timeout_ms = 0;
329+
325330
engine->context_size = intel_engine_context_size(gt, engine->class);
326331
if (WARN_ON(engine->context_size > BIT(20)))
327332
engine->context_size = 0;
328333
if (engine->context_size)
329-
DRIVER_CAPS(gt->i915)->has_logical_contexts = true;
334+
DRIVER_CAPS(i915)->has_logical_contexts = true;
330335

331336
/* Nothing to do here, execute in order of dependencies */
332337
engine->schedule = NULL;
@@ -342,7 +347,7 @@ static int intel_engine_setup(struct intel_gt *gt, enum intel_engine_id id)
342347
gt->engine_class[info->class][info->instance] = engine;
343348
gt->engine[id] = engine;
344349

345-
gt->i915->engine[id] = engine;
350+
i915->engine[id] = engine;
346351

347352
return 0;
348353
}

0 commit comments

Comments
 (0)