From patchwork Fri Aug 10 07:01:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10562283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C3CF13BB for ; Fri, 10 Aug 2018 07:01:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AEFB2B710 for ; Fri, 10 Aug 2018 07:01:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E47E2B79E; Fri, 10 Aug 2018 07:01:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AE1752B725 for ; Fri, 10 Aug 2018 07:01:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5B0E56E89B; Fri, 10 Aug 2018 07:01:31 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id 164EF6E897; Fri, 10 Aug 2018 07:01:28 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 12769997-1500050 for multiple; Fri, 10 Aug 2018 08:01:18 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 10 Aug 2018 08:01:16 +0100 Message-Id: <20180810070116.29667-2-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810070116.29667-1-chris@chris-wilson.co.uk> References: <20180810070116.29667-1-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH i-g-t 2/2] igt/pm_rpm: Test reaquisition of runtime-pm after module reload X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, imre.deak@linux.intel.com MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP It doesn't work right now and desperately needs to be fixed... Signed-off-by: Chris Wilson Reviewed-by: Imre Deak --- tests/intel-ci/fast-feedback.testlist | 1 + tests/pm_rpm.c | 28 ++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist index 1f3b95357..c625904d5 100644 --- a/tests/intel-ci/fast-feedback.testlist +++ b/tests/intel-ci/fast-feedback.testlist @@ -272,3 +272,4 @@ igt@vgem_basic@unload igt@drv_module_reload@basic-reload igt@drv_module_reload@basic-no-display igt@drv_module_reload@basic-reload-inject +igt@pm_rpm@module-reload diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c index 1fbdda4ed..79cdf969a 100644 --- a/tests/pm_rpm.c +++ b/tests/pm_rpm.c @@ -692,7 +692,7 @@ static void setup_pc8(void) has_pc8 = true; } -static void setup_environment(void) +static bool setup_environment(void) { drm_fd = drm_open_driver_master(DRIVER_INTEL); debugfs = igt_debugfs_dir(drm_fd); @@ -710,7 +710,7 @@ static void setup_environment(void) igt_require(has_runtime_pm); disable_all_screens(&ms_data); - igt_require(wait_for_suspended()); + return wait_for_suspended(); } static void restore_environment(void) @@ -1905,7 +1905,7 @@ int main(int argc, char *argv[]) * PC8+. We don't want bug reports from cases where the machine is just * not properly configured. */ igt_fixture - setup_environment(); + igt_require(setup_environment()); if (stay) igt_subtest("stay") @@ -2026,5 +2026,27 @@ int main(int argc, char *argv[]) igt_fixture teardown_environment(); + igt_subtest("module-reload") { + igt_debug("Reload w/o display\n"); + igt_i915_driver_unload(); + igt_assert_eq(igt_i915_driver_load("disable_display=1"), 0); + + igt_assert(setup_environment()); + basic_subtest(); + drm_resources_equal_subtest(); + pci_d3_state_subtest(); + teardown_environment(); + + igt_debug("Reload as normal\n"); + igt_i915_driver_unload(); + igt_assert_eq(igt_i915_driver_load(NULL), 0); + + igt_assert(setup_environment()); + basic_subtest(); + drm_resources_equal_subtest(); + pci_d3_state_subtest(); + teardown_environment(); + } + igt_exit(); }