mirror of
https://github.com/torvalds/linux.git
synced 2026-05-01 04:52:32 -04:00
drm/i915: Pack params to engine->schedule() into a struct
Today we only want to pass along the priority to engine->schedule(), but in the future we want to have much more control over the various aspects of the GPU during a context's execution, for example controlling the frequency allowed. As we need an ever growing number of parameters for scheduling, move those into a struct for convenience. v2: Move the anonymous struct into its own function for legibility and ye olde gcc. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180418184052.7129-3-chris@chris-wilson.co.uk
This commit is contained in:
@@ -628,7 +628,7 @@ static int active_engine(void *data)
|
||||
}
|
||||
|
||||
if (arg->flags & TEST_PRIORITY)
|
||||
ctx[idx]->priority =
|
||||
ctx[idx]->sched.priority =
|
||||
i915_prandom_u32_max_state(512, &prng);
|
||||
|
||||
rq[idx] = i915_request_get(new);
|
||||
@@ -683,7 +683,7 @@ static int __igt_reset_engines(struct drm_i915_private *i915,
|
||||
return err;
|
||||
|
||||
if (flags & TEST_PRIORITY)
|
||||
h.ctx->priority = 1024;
|
||||
h.ctx->sched.priority = 1024;
|
||||
}
|
||||
|
||||
for_each_engine(engine, i915, id) {
|
||||
|
||||
@@ -335,12 +335,12 @@ static int live_preempt(void *arg)
|
||||
ctx_hi = kernel_context(i915);
|
||||
if (!ctx_hi)
|
||||
goto err_spin_lo;
|
||||
ctx_hi->priority = I915_CONTEXT_MAX_USER_PRIORITY;
|
||||
ctx_hi->sched.priority = I915_CONTEXT_MAX_USER_PRIORITY;
|
||||
|
||||
ctx_lo = kernel_context(i915);
|
||||
if (!ctx_lo)
|
||||
goto err_ctx_hi;
|
||||
ctx_lo->priority = I915_CONTEXT_MIN_USER_PRIORITY;
|
||||
ctx_lo->sched.priority = I915_CONTEXT_MIN_USER_PRIORITY;
|
||||
|
||||
for_each_engine(engine, i915, id) {
|
||||
struct i915_request *rq;
|
||||
@@ -407,6 +407,7 @@ static int live_late_preempt(void *arg)
|
||||
struct i915_gem_context *ctx_hi, *ctx_lo;
|
||||
struct spinner spin_hi, spin_lo;
|
||||
struct intel_engine_cs *engine;
|
||||
struct i915_sched_attr attr = {};
|
||||
enum intel_engine_id id;
|
||||
int err = -ENOMEM;
|
||||
|
||||
@@ -458,7 +459,8 @@ static int live_late_preempt(void *arg)
|
||||
goto err_wedged;
|
||||
}
|
||||
|
||||
engine->schedule(rq, I915_PRIORITY_MAX);
|
||||
attr.priority = I915_PRIORITY_MAX;
|
||||
engine->schedule(rq, &attr);
|
||||
|
||||
if (!wait_for_spinner(&spin_hi, rq)) {
|
||||
pr_err("High priority context failed to preempt the low priority context\n");
|
||||
|
||||
Reference in New Issue
Block a user