Now that we rapidly park the GT when the GPU idles, we often find ourselves idling faster than the RC6 promotion timer. Thus if we tell the GPU to enter RC6 manually as we park, we can do so quicker (by around 50ms, half an EI on average) and marginally increase our powersaving across all execlists platforms. v2: Now with a selftest to check we can enter RC6 manually Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Andi Shyti <andi.shyti@intel.com> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Cc: Imre Deak <imre.deak@intel.com> Acked-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Andi Shyti <andi.shyti@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191127095657.3209854-1-chris@chris-wilson.co.uk
80 lines
1.6 KiB
C
80 lines
1.6 KiB
C
|
|
/*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
* Copyright © 2019 Intel Corporation
|
|
*/
|
|
|
|
#include "selftest_llc.h"
|
|
#include "selftest_rc6.h"
|
|
|
|
static int live_gt_resume(void *arg)
|
|
{
|
|
struct intel_gt *gt = arg;
|
|
IGT_TIMEOUT(end_time);
|
|
int err;
|
|
|
|
/* Do several suspend/resume cycles to check we don't explode! */
|
|
do {
|
|
intel_gt_suspend_prepare(gt);
|
|
intel_gt_suspend_late(gt);
|
|
|
|
if (gt->rc6.enabled) {
|
|
pr_err("rc6 still enabled after suspend!\n");
|
|
intel_gt_set_wedged_on_init(gt);
|
|
err = -EINVAL;
|
|
break;
|
|
}
|
|
|
|
err = intel_gt_resume(gt);
|
|
if (err)
|
|
break;
|
|
|
|
if (gt->rc6.supported && !gt->rc6.enabled) {
|
|
pr_err("rc6 not enabled upon resume!\n");
|
|
intel_gt_set_wedged_on_init(gt);
|
|
err = -EINVAL;
|
|
break;
|
|
}
|
|
|
|
err = st_llc_verify(>->llc);
|
|
if (err) {
|
|
pr_err("llc state not restored upon resume!\n");
|
|
intel_gt_set_wedged_on_init(gt);
|
|
break;
|
|
}
|
|
} while (!__igt_timeout(end_time, NULL));
|
|
|
|
return err;
|
|
}
|
|
|
|
int intel_gt_pm_live_selftests(struct drm_i915_private *i915)
|
|
{
|
|
static const struct i915_subtest tests[] = {
|
|
SUBTEST(live_rc6_manual),
|
|
SUBTEST(live_gt_resume),
|
|
};
|
|
|
|
if (intel_gt_is_wedged(&i915->gt))
|
|
return 0;
|
|
|
|
return intel_gt_live_subtests(tests, &i915->gt);
|
|
}
|
|
|
|
int intel_gt_pm_late_selftests(struct drm_i915_private *i915)
|
|
{
|
|
static const struct i915_subtest tests[] = {
|
|
/*
|
|
* These tests may leave the system in an undesirable state.
|
|
* They are intended to be run last in CI and the system
|
|
* rebooted afterwards.
|
|
*/
|
|
SUBTEST(live_rc6_ctx_wa),
|
|
};
|
|
|
|
if (intel_gt_is_wedged(&i915->gt))
|
|
return 0;
|
|
|
|
return intel_gt_live_subtests(tests, &i915->gt);
|
|
}
|