From patchwork Tue Jul 11 22:48:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: jim.bride@linux.intel.com X-Patchwork-Id: 9835609 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 61976602BD for ; Tue, 11 Jul 2017 22:51:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46FD7285CA for ; Tue, 11 Jul 2017 22:51:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A548285CC; Tue, 11 Jul 2017 22:51:10 +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=-4.2 required=2.0 tests=BAYES_00, 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 B806B285CB for ; Tue, 11 Jul 2017 22:51:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C9BC6E31E; Tue, 11 Jul 2017 22:51:08 +0000 (UTC) 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 ESMTPS id B34696E31E for ; Tue, 11 Jul 2017 22:51:07 +0000 (UTC) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jul 2017 15:51:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,347,1496127600"; d="scan'208";a="123996630" Received: from shiv.jf.intel.com ([10.54.75.141]) by orsmga005.jf.intel.com with ESMTP; 11 Jul 2017 15:51:06 -0700 From: Jim Bride To: intel-gfx@lists.freedesktop.org Date: Tue, 11 Jul 2017 15:48:29 -0700 Message-Id: <1499813316-15038-5-git-send-email-jim.bride@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499813316-15038-1-git-send-email-jim.bride@linux.intel.com> References: <1499813316-15038-1-git-send-email-jim.bride@linux.intel.com> MIME-Version: 1.0 Cc: Paulo Zanoni , Rodrigo Vivi Subject: [Intel-gfx] [PATCH IGT 04/11] lib: Add utility functions to enable and disable PSR. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Create files to contain PSR-specific IGT functions and add macros to enable and disable PSR. Cc: Rodrigo Vivi Cc: Paulo Zanoni Signed-off-by: Jim Bride --- lib/Makefile.sources | 1 + lib/igt.h | 1 + lib/igt_psr.h | 30 ++++++++++++++++++++++++++++++ tests/kms_fbcon_fbt.c | 2 +- tests/kms_frontbuffer_tracking.c | 4 ++-- tests/kms_psr_sink_crc.c | 8 +++++--- 6 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 lib/igt_psr.h diff --git a/lib/Makefile.sources b/lib/Makefile.sources index 53fdb54..7ec6711 100644 --- a/lib/Makefile.sources +++ b/lib/Makefile.sources @@ -83,6 +83,7 @@ lib_source_list = \ uwildmat/uwildmat.c \ igt_kmod.c \ igt_kmod.h \ + igt_psr.h \ $(NULL) .PHONY: version.h.tmp diff --git a/lib/igt.h b/lib/igt.h index a069deb..807ed99 100644 --- a/lib/igt.h +++ b/lib/igt.h @@ -38,6 +38,7 @@ #include "igt_kms.h" #include "igt_pm.h" #include "igt_stats.h" +#include "igt_psr.h" #ifdef HAVE_CHAMELIUM #include "igt_chamelium.h" #endif diff --git a/lib/igt_psr.h b/lib/igt_psr.h new file mode 100644 index 0000000..71b1233 --- /dev/null +++ b/lib/igt_psr.h @@ -0,0 +1,30 @@ +/* + * Copyright © 2017 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef IGT_PSR_H +#define IGT_PSR_H + +#define igt_psr_enable() igt_set_module_param_int("enable_psr", 1) +#define igt_psr_disable() igt_set_module_param_int("enable_psr", 0) + +#endif /* IGT_PSR_H */ diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c index d009091..4b9cb43 100644 --- a/tests/kms_fbcon_fbt.c +++ b/tests/kms_fbcon_fbt.c @@ -193,7 +193,7 @@ struct feature { static void disable_features(void) { igt_set_module_param_int(fbc.param_name, 0); - igt_set_module_param_int(psr.param_name, 0); + igt_psr_disable(); } static void subtest(struct feature *feature, bool suspend) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 2e9a169..3c30745 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -927,8 +927,8 @@ static bool psr_wait_until_enabled(void) #define fbc_enable() igt_set_module_param_int("enable_fbc", 1) #define fbc_disable() igt_set_module_param_int("enable_fbc", 0) -#define psr_enable() igt_set_module_param_int("enable_psr", 1) -#define psr_disable() igt_set_module_param_int("enable_psr", 0) +#define psr_enable() igt_psr_enable() +#define psr_disable() igt_psr_disable() static void get_sink_crc(sink_crc_t *crc, bool mandatory) { diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c index 1a03719..c0404b2 100644 --- a/tests/kms_psr_sink_crc.c +++ b/tests/kms_psr_sink_crc.c @@ -507,9 +507,11 @@ int main(int argc, char *argv[]) kmstest_set_vt_graphics_mode(); data.devid = intel_get_drm_devid(data.drm_fd); - igt_set_module_param_int("enable_psr", running_with_psr_disabled ? - 0 : 1); - + if (running_with_psr_disabled) + igt_psr_disable(); + else + igt_psr_enable(); + igt_skip_on(!psr_possible(&data)); data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);