Lines Matching refs:smoke

3486 static struct i915_gem_context *smoke_context(struct preempt_smoke *smoke)  in smoke_context()  argument
3488 return smoke->contexts[i915_prandom_u32_max_state(smoke->ncontext, in smoke_context()
3489 &smoke->prng)]; in smoke_context()
3492 static int smoke_submit(struct preempt_smoke *smoke, in smoke_submit() argument
3516 rq = igt_request_alloc(ctx, smoke->engine); in smoke_submit()
3545 struct preempt_smoke *smoke = arg; in smoke_crescendo_thread() local
3551 struct i915_gem_context *ctx = smoke_context(smoke); in smoke_crescendo_thread()
3554 err = smoke_submit(smoke, in smoke_crescendo_thread()
3556 smoke->batch); in smoke_crescendo_thread()
3561 } while (count < smoke->ncontext && !__igt_timeout(end_time, NULL)); in smoke_crescendo_thread()
3563 smoke->count = count; in smoke_crescendo_thread()
3567 static int smoke_crescendo(struct preempt_smoke *smoke, unsigned int flags) in smoke_crescendo() argument
3581 for_each_engine(engine, smoke->gt, id) { in smoke_crescendo()
3582 arg[id] = *smoke; in smoke_crescendo()
3600 for_each_engine(engine, smoke->gt, id) { in smoke_crescendo()
3616 count, flags, smoke->gt->info.num_engines, smoke->ncontext); in smoke_crescendo()
3622 static int smoke_random(struct preempt_smoke *smoke, unsigned int flags) in smoke_random() argument
3630 for_each_engine(smoke->engine, smoke->gt, id) { in smoke_random()
3631 struct i915_gem_context *ctx = smoke_context(smoke); in smoke_random()
3634 err = smoke_submit(smoke, in smoke_random()
3635 ctx, random_priority(&smoke->prng), in smoke_random()
3636 flags & BATCH ? smoke->batch : NULL); in smoke_random()
3642 } while (count < smoke->ncontext && !__igt_timeout(end_time, NULL)); in smoke_random()
3645 count, flags, smoke->gt->info.num_engines, smoke->ncontext); in smoke_random()
3651 struct preempt_smoke smoke = { in live_preempt_smoke() local
3662 smoke.contexts = kmalloc_array(smoke.ncontext, in live_preempt_smoke()
3663 sizeof(*smoke.contexts), in live_preempt_smoke()
3665 if (!smoke.contexts) in live_preempt_smoke()
3668 smoke.batch = in live_preempt_smoke()
3669 i915_gem_object_create_internal(smoke.gt->i915, PAGE_SIZE); in live_preempt_smoke()
3670 if (IS_ERR(smoke.batch)) { in live_preempt_smoke()
3671 err = PTR_ERR(smoke.batch); in live_preempt_smoke()
3675 cs = i915_gem_object_pin_map_unlocked(smoke.batch, I915_MAP_WB); in live_preempt_smoke()
3683 i915_gem_object_flush_map(smoke.batch); in live_preempt_smoke()
3684 i915_gem_object_unpin_map(smoke.batch); in live_preempt_smoke()
3686 if (igt_live_test_begin(&t, smoke.gt->i915, __func__, "all")) { in live_preempt_smoke()
3691 for (n = 0; n < smoke.ncontext; n++) { in live_preempt_smoke()
3692 smoke.contexts[n] = kernel_context(smoke.gt->i915, NULL); in live_preempt_smoke()
3693 if (!smoke.contexts[n]) in live_preempt_smoke()
3698 err = smoke_crescendo(&smoke, phase[n]); in live_preempt_smoke()
3702 err = smoke_random(&smoke, phase[n]); in live_preempt_smoke()
3711 for (n = 0; n < smoke.ncontext; n++) { in live_preempt_smoke()
3712 if (!smoke.contexts[n]) in live_preempt_smoke()
3714 kernel_context_close(smoke.contexts[n]); in live_preempt_smoke()
3718 i915_gem_object_put(smoke.batch); in live_preempt_smoke()
3720 kfree(smoke.contexts); in live_preempt_smoke()