Lines Matching refs:smoke

3445 static struct i915_gem_context *smoke_context(struct preempt_smoke *smoke)  in smoke_context()  argument
3447 return smoke->contexts[i915_prandom_u32_max_state(smoke->ncontext, in smoke_context()
3448 &smoke->prng)]; in smoke_context()
3451 static int smoke_submit(struct preempt_smoke *smoke, in smoke_submit() argument
3475 rq = igt_request_alloc(ctx, smoke->engine); in smoke_submit()
3504 struct preempt_smoke *smoke = arg; in smoke_crescendo_thread() local
3510 struct i915_gem_context *ctx = smoke_context(smoke); in smoke_crescendo_thread()
3513 err = smoke_submit(smoke, in smoke_crescendo_thread()
3515 smoke->batch); in smoke_crescendo_thread()
3520 } while (count < smoke->ncontext && !__igt_timeout(end_time, NULL)); in smoke_crescendo_thread()
3522 smoke->count = count; in smoke_crescendo_thread()
3526 static int smoke_crescendo(struct preempt_smoke *smoke, unsigned int flags) in smoke_crescendo() argument
3536 for_each_engine(engine, smoke->gt, id) { in smoke_crescendo()
3537 arg[id] = *smoke; in smoke_crescendo()
3555 for_each_engine(engine, smoke->gt, id) { in smoke_crescendo()
3571 count, flags, smoke->gt->info.num_engines, smoke->ncontext); in smoke_crescendo()
3575 static int smoke_random(struct preempt_smoke *smoke, unsigned int flags) in smoke_random() argument
3583 for_each_engine(smoke->engine, smoke->gt, id) { in smoke_random()
3584 struct i915_gem_context *ctx = smoke_context(smoke); in smoke_random()
3587 err = smoke_submit(smoke, in smoke_random()
3588 ctx, random_priority(&smoke->prng), in smoke_random()
3589 flags & BATCH ? smoke->batch : NULL); in smoke_random()
3595 } while (count < smoke->ncontext && !__igt_timeout(end_time, NULL)); in smoke_random()
3598 count, flags, smoke->gt->info.num_engines, smoke->ncontext); in smoke_random()
3604 struct preempt_smoke smoke = { in live_preempt_smoke() local
3615 if (!HAS_LOGICAL_RING_PREEMPTION(smoke.gt->i915)) in live_preempt_smoke()
3618 smoke.contexts = kmalloc_array(smoke.ncontext, in live_preempt_smoke()
3619 sizeof(*smoke.contexts), in live_preempt_smoke()
3621 if (!smoke.contexts) in live_preempt_smoke()
3624 smoke.batch = in live_preempt_smoke()
3625 i915_gem_object_create_internal(smoke.gt->i915, PAGE_SIZE); in live_preempt_smoke()
3626 if (IS_ERR(smoke.batch)) { in live_preempt_smoke()
3627 err = PTR_ERR(smoke.batch); in live_preempt_smoke()
3631 cs = i915_gem_object_pin_map(smoke.batch, I915_MAP_WB); in live_preempt_smoke()
3639 i915_gem_object_flush_map(smoke.batch); in live_preempt_smoke()
3640 i915_gem_object_unpin_map(smoke.batch); in live_preempt_smoke()
3642 if (igt_live_test_begin(&t, smoke.gt->i915, __func__, "all")) { in live_preempt_smoke()
3647 for (n = 0; n < smoke.ncontext; n++) { in live_preempt_smoke()
3648 smoke.contexts[n] = kernel_context(smoke.gt->i915); in live_preempt_smoke()
3649 if (!smoke.contexts[n]) in live_preempt_smoke()
3654 err = smoke_crescendo(&smoke, phase[n]); in live_preempt_smoke()
3658 err = smoke_random(&smoke, phase[n]); in live_preempt_smoke()
3667 for (n = 0; n < smoke.ncontext; n++) { in live_preempt_smoke()
3668 if (!smoke.contexts[n]) in live_preempt_smoke()
3670 kernel_context_close(smoke.contexts[n]); in live_preempt_smoke()
3674 i915_gem_object_put(smoke.batch); in live_preempt_smoke()
3676 kfree(smoke.contexts); in live_preempt_smoke()