From patchwork Thu Sep 4 01:29:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 4842061 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7F25E9F2EC for ; Thu, 4 Sep 2014 01:30:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 546B620254 for ; Thu, 4 Sep 2014 01:30:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 678CC20221 for ; Thu, 4 Sep 2014 01:30:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 23F006E61A; Wed, 3 Sep 2014 18:30:14 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 0E9F76E60D for ; Wed, 3 Sep 2014 18:30:09 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 03 Sep 2014 18:30:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,462,1406617200"; d="scan'208";a="568049928" Received: from rdvivi-bratislava.jf.intel.com ([10.7.196.74]) by orsmga001.jf.intel.com with ESMTP; 03 Sep 2014 18:30:07 -0700 From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Wed, 3 Sep 2014 21:29:58 -0400 Message-Id: <1409794206-2126-4-git-send-email-rodrigo.vivi@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1409794206-2126-1-git-send-email-rodrigo.vivi@intel.com> References: <1409794206-2126-1-git-send-email-rodrigo.vivi@intel.com> Cc: Rodrigo Vivi Subject: [Intel-gfx] [PATCH 04/12] tests/kms_psr_sink_crc: Fix edp_psr debugfs interface X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Tests were broken on platforms that doesn't have psr or on new kernel that contains new interface. A lot more need to be done to get these tests really useful, but for now lets avoid it breaking tests framework. v2: Doesn't duplicate kernel's HAS_PSR. skip based on debugfs output. Signed-off-by: Rodrigo Vivi --- tests/kms_psr_sink_crc.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c index 49f9549..0917a7f 100644 --- a/tests/kms_psr_sink_crc.c +++ b/tests/kms_psr_sink_crc.c @@ -258,7 +258,7 @@ static void fill_render(data_t *data, uint32_t handle, gem_bo_busy(data->drm_fd, handle); } -static bool psr_sink_support(data_t *data) +static bool psr_enabled(data_t *data) { int ret; FILE *file; @@ -268,14 +268,17 @@ static bool psr_sink_support(data_t *data) igt_require(file); ret = fscanf(file, "Sink_Support: %s\n", str); - igt_skip_on_f(ret == 0, - "i915_edp_psr_status format not supported by this test case\n"); + igt_assert(ret != 0); + ret = fscanf(file, "Source_OK: %s\n", str); + igt_assert(ret != 0); + ret = fscanf(file, "Enabled: %s\n", str); + igt_assert(ret != 0); fclose(file); return strcmp(str, "yes") == 0; } -static bool psr_enabled(data_t *data) +static bool psr_active(data_t *data) { int ret; FILE *file; @@ -286,12 +289,18 @@ static bool psr_enabled(data_t *data) ret = fscanf(file, "Sink_Support: %s\n", str); igt_assert(ret != 0); - ret = fscanf(file, "Source_OK: %s\n", str); igt_assert(ret != 0); - ret = fscanf(file, "Enabled: %s\n", str); igt_assert(ret != 0); + ret = fscanf(file, "Active: %s\n", str); + igt_assert(ret != 0); + ret = fscanf(file, "Busy frontbuffer bits: %s\n", str); + igt_assert(ret != 0); + ret = fscanf(file, "Re-enable work scheduled: %s\n", str); + igt_assert(ret != 0); + ret = fscanf(file, "HW Enabled & Active bit: %s\n", str); + igt_assert(ret != 0); fclose(file); return strcmp(str, "yes") == 0; @@ -300,7 +309,7 @@ static bool psr_enabled(data_t *data) static bool wait_psr_entry(data_t *data, int timeout) { while (timeout--) { - if (psr_enabled(data)) + if (psr_active(data)) return true; sleep(1); } @@ -512,8 +521,6 @@ static void test_sprite(data_t *data) igt_output_t *output; drmModeModeInfo *mode; - igt_skip_on(IS_HASWELL(data->devid)); - for_each_connected_output(display, output) { drmModeConnectorPtr c = output->config.connector; @@ -592,7 +599,7 @@ igt_main data.devid = intel_get_drm_devid(data.drm_fd); - igt_require(psr_sink_support(&data)); + igt_skip_on(!psr_enabled(&data)); data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096); igt_assert(data.bufmgr);