smoke            1428 drivers/gpu/drm/i915/gt/selftest_lrc.c static struct i915_gem_context *smoke_context(struct preempt_smoke *smoke)
smoke            1430 drivers/gpu/drm/i915/gt/selftest_lrc.c 	return smoke->contexts[i915_prandom_u32_max_state(smoke->ncontext,
smoke            1431 drivers/gpu/drm/i915/gt/selftest_lrc.c 							  &smoke->prng)];
smoke            1434 drivers/gpu/drm/i915/gt/selftest_lrc.c static int smoke_submit(struct preempt_smoke *smoke,
smoke            1454 drivers/gpu/drm/i915/gt/selftest_lrc.c 	rq = igt_request_alloc(ctx, smoke->engine);
smoke            1483 drivers/gpu/drm/i915/gt/selftest_lrc.c 	struct preempt_smoke *smoke = arg;
smoke            1489 drivers/gpu/drm/i915/gt/selftest_lrc.c 		struct i915_gem_context *ctx = smoke_context(smoke);
smoke            1492 drivers/gpu/drm/i915/gt/selftest_lrc.c 		mutex_lock(&smoke->i915->drm.struct_mutex);
smoke            1493 drivers/gpu/drm/i915/gt/selftest_lrc.c 		err = smoke_submit(smoke,
smoke            1495 drivers/gpu/drm/i915/gt/selftest_lrc.c 				   smoke->batch);
smoke            1496 drivers/gpu/drm/i915/gt/selftest_lrc.c 		mutex_unlock(&smoke->i915->drm.struct_mutex);
smoke            1503 drivers/gpu/drm/i915/gt/selftest_lrc.c 	smoke->count = count;
smoke            1507 drivers/gpu/drm/i915/gt/selftest_lrc.c static int smoke_crescendo(struct preempt_smoke *smoke, unsigned int flags)
smoke            1517 drivers/gpu/drm/i915/gt/selftest_lrc.c 	mutex_unlock(&smoke->i915->drm.struct_mutex);
smoke            1519 drivers/gpu/drm/i915/gt/selftest_lrc.c 	for_each_engine(engine, smoke->i915, id) {
smoke            1520 drivers/gpu/drm/i915/gt/selftest_lrc.c 		arg[id] = *smoke;
smoke            1536 drivers/gpu/drm/i915/gt/selftest_lrc.c 	for_each_engine(engine, smoke->i915, id) {
smoke            1551 drivers/gpu/drm/i915/gt/selftest_lrc.c 	mutex_lock(&smoke->i915->drm.struct_mutex);
smoke            1555 drivers/gpu/drm/i915/gt/selftest_lrc.c 		RUNTIME_INFO(smoke->i915)->num_engines, smoke->ncontext);
smoke            1559 drivers/gpu/drm/i915/gt/selftest_lrc.c static int smoke_random(struct preempt_smoke *smoke, unsigned int flags)
smoke            1567 drivers/gpu/drm/i915/gt/selftest_lrc.c 		for_each_engine(smoke->engine, smoke->i915, id) {
smoke            1568 drivers/gpu/drm/i915/gt/selftest_lrc.c 			struct i915_gem_context *ctx = smoke_context(smoke);
smoke            1571 drivers/gpu/drm/i915/gt/selftest_lrc.c 			err = smoke_submit(smoke,
smoke            1572 drivers/gpu/drm/i915/gt/selftest_lrc.c 					   ctx, random_priority(&smoke->prng),
smoke            1573 drivers/gpu/drm/i915/gt/selftest_lrc.c 					   flags & BATCH ? smoke->batch : NULL);
smoke            1583 drivers/gpu/drm/i915/gt/selftest_lrc.c 		RUNTIME_INFO(smoke->i915)->num_engines, smoke->ncontext);
smoke            1589 drivers/gpu/drm/i915/gt/selftest_lrc.c 	struct preempt_smoke smoke = {
smoke            1601 drivers/gpu/drm/i915/gt/selftest_lrc.c 	if (!HAS_LOGICAL_RING_PREEMPTION(smoke.i915))
smoke            1604 drivers/gpu/drm/i915/gt/selftest_lrc.c 	smoke.contexts = kmalloc_array(smoke.ncontext,
smoke            1605 drivers/gpu/drm/i915/gt/selftest_lrc.c 				       sizeof(*smoke.contexts),
smoke            1607 drivers/gpu/drm/i915/gt/selftest_lrc.c 	if (!smoke.contexts)
smoke            1610 drivers/gpu/drm/i915/gt/selftest_lrc.c 	mutex_lock(&smoke.i915->drm.struct_mutex);
smoke            1611 drivers/gpu/drm/i915/gt/selftest_lrc.c 	wakeref = intel_runtime_pm_get(&smoke.i915->runtime_pm);
smoke            1613 drivers/gpu/drm/i915/gt/selftest_lrc.c 	smoke.batch = i915_gem_object_create_internal(smoke.i915, PAGE_SIZE);
smoke            1614 drivers/gpu/drm/i915/gt/selftest_lrc.c 	if (IS_ERR(smoke.batch)) {
smoke            1615 drivers/gpu/drm/i915/gt/selftest_lrc.c 		err = PTR_ERR(smoke.batch);
smoke            1619 drivers/gpu/drm/i915/gt/selftest_lrc.c 	cs = i915_gem_object_pin_map(smoke.batch, I915_MAP_WB);
smoke            1627 drivers/gpu/drm/i915/gt/selftest_lrc.c 	i915_gem_object_flush_map(smoke.batch);
smoke            1628 drivers/gpu/drm/i915/gt/selftest_lrc.c 	i915_gem_object_unpin_map(smoke.batch);
smoke            1630 drivers/gpu/drm/i915/gt/selftest_lrc.c 	if (igt_live_test_begin(&t, smoke.i915, __func__, "all")) {
smoke            1635 drivers/gpu/drm/i915/gt/selftest_lrc.c 	for (n = 0; n < smoke.ncontext; n++) {
smoke            1636 drivers/gpu/drm/i915/gt/selftest_lrc.c 		smoke.contexts[n] = kernel_context(smoke.i915);
smoke            1637 drivers/gpu/drm/i915/gt/selftest_lrc.c 		if (!smoke.contexts[n])
smoke            1642 drivers/gpu/drm/i915/gt/selftest_lrc.c 		err = smoke_crescendo(&smoke, phase[n]);
smoke            1646 drivers/gpu/drm/i915/gt/selftest_lrc.c 		err = smoke_random(&smoke, phase[n]);
smoke            1655 drivers/gpu/drm/i915/gt/selftest_lrc.c 	for (n = 0; n < smoke.ncontext; n++) {
smoke            1656 drivers/gpu/drm/i915/gt/selftest_lrc.c 		if (!smoke.contexts[n])
smoke            1658 drivers/gpu/drm/i915/gt/selftest_lrc.c 		kernel_context_close(smoke.contexts[n]);
smoke            1662 drivers/gpu/drm/i915/gt/selftest_lrc.c 	i915_gem_object_put(smoke.batch);
smoke            1664 drivers/gpu/drm/i915/gt/selftest_lrc.c 	intel_runtime_pm_put(&smoke.i915->runtime_pm, wakeref);
smoke            1665 drivers/gpu/drm/i915/gt/selftest_lrc.c 	mutex_unlock(&smoke.i915->drm.struct_mutex);
smoke            1666 drivers/gpu/drm/i915/gt/selftest_lrc.c 	kfree(smoke.contexts);