From patchwork Thu Jun 4 14:31:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 6547671 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B46289F1CC for ; Thu, 4 Jun 2015 14:32:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D05E22060A for ; Thu, 4 Jun 2015 14:32:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 076A3205FC for ; Thu, 4 Jun 2015 14:32:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 79DEC6EB66; Thu, 4 Jun 2015 07:32:07 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qk0-f176.google.com (mail-qk0-f176.google.com [209.85.220.176]) by gabe.freedesktop.org (Postfix) with ESMTP id 39F906EB6D for ; Thu, 4 Jun 2015 07:32:06 -0700 (PDT) Received: by qkhq76 with SMTP id q76so24627688qkh.2 for ; Thu, 04 Jun 2015 07:32:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aGz6RpHSXQdxKYsh7wmaPmdN5SAlAjr1+e+c/m5b8yg=; b=dz1cpiA86d1Nf8J9dPvYmgUcWBWsmHrP54lIRKZKbSYqhnEBuXuJbV2EPfRyV/yqFH 4dPu5STRN00WP6WXQHwYVQf6FU8rkWb8C5zABUD7uts93lHUiGS5XMAFco3zm2PFJuxZ 9xaamFAIclh2ALracPzOSkvmKOJ/XvyMHJnhPuQSAH8lZhKYd1uUNlgRYMnYO75bIQc2 aTIQ57HCd4zaI0qSmPnY/8Sg6rtAyh2lBiJ/ugj+I6J4+e0dB4WnpnSJ8kilDkREXFj+ EsFsbSitMSRvI0OANL+6iWCOkb9E9cog6oHvdoBLzsPZ3sQo/tEv3psLFG7tD8kpTcYc Axyw== X-Received: by 10.140.51.106 with SMTP id t97mr42664874qga.44.1433428325757; Thu, 04 Jun 2015 07:32:05 -0700 (PDT) Received: from localhost.localdomain ([177.92.20.165]) by mx.google.com with ESMTPSA id f33sm2445470qkf.7.2015.06.04.07.32.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jun 2015 07:32:05 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 4 Jun 2015 11:31:06 -0300 Message-Id: <1433428266-1867-4-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1433428266-1867-1-git-send-email-przanoni@gmail.com> References: <1433428266-1867-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni , Rodrigo Vivi Subject: [Intel-gfx] [PATCH igt 4/4] tests/kms_psr_sink_crc: test even if PSR is disabled by default 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: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 From: Paulo Zanoni Use the igt_set_module_param_int() call to enable it, then restore the previous value after we are done testing. With this, we can change the psr_enabled() function to psr_possible(): the only requirement should be that we have a PSR capable sink. The test should now be able to make "Source_OK" and "Enabled" become true whenever it wants. Cc: Rodrigo Vivi Signed-off-by: Paulo Zanoni Acked-by: Rodrigo Vivi --- tests/kms_psr_sink_crc.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c index 099391b..1823a68 100644 --- a/tests/kms_psr_sink_crc.c +++ b/tests/kms_psr_sink_crc.c @@ -203,7 +203,7 @@ static void fill_render(data_t *data, uint32_t handle, unsigned char color) gem_bo_busy(data->drm_fd, handle); } -static bool psr_enabled(data_t *data) +static bool psr_possible(data_t *data) { FILE *file; char buf[4096]; @@ -229,14 +229,6 @@ static bool psr_enabled(data_t *data) igt_require_f(ret == 1 && strcmp(buf, "yes") == 0, "Sink_Support: %s\n", buf); - ret = fscanf(file, "Source_OK: %s\n", buf); - igt_require_f(ret == 1 && strcmp(buf, "yes") == 0, - "Source_OK: %s\n", buf); - - ret = fscanf(file, "Enabled: %s\n", buf); - igt_require_f(ret == 1 && strcmp(buf, "yes") == 0, - "Enabled: %s\n", buf); - fclose(file); return true; } @@ -570,7 +562,9 @@ int main(int argc, char *argv[]) kmstest_set_vt_graphics_mode(); data.devid = intel_get_drm_devid(data.drm_fd); - igt_skip_on(!psr_enabled(&data)); + igt_set_module_param_int("enable_psr", 1); + + igt_skip_on(!psr_possible(&data)); data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096); igt_assert(data.bufmgr);