From patchwork Tue Sep 9 23:09:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 4873331 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 2BF629F32F for ; Tue, 9 Sep 2014 23:09:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42C47201B4 for ; Tue, 9 Sep 2014 23:09:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 777B12018E for ; Tue, 9 Sep 2014 23:09:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 01AC589DA3; Tue, 9 Sep 2014 16:09:52 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 2337289DA3 for ; Tue, 9 Sep 2014 16:09:50 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 09 Sep 2014 16:03:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,494,1406617200"; d="scan'208";a="570837428" Received: from rdvivi-bratislava.jf.intel.com ([10.7.196.158]) by orsmga001.jf.intel.com with ESMTP; 09 Sep 2014 16:09:49 -0700 From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Tue, 9 Sep 2014 19:09:49 -0400 Message-Id: <1410304189-5886-1-git-send-email-rodrigo.vivi@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1409794206-2126-3-git-send-email-rodrigo.vivi@intel.com> References: <1409794206-2126-3-git-send-email-rodrigo.vivi@intel.com> Cc: Rodrigo Vivi Subject: [Intel-gfx] [PATCH] tests/kms_sink_crc_basic: Wait 2 vblanks before grabing the new crc. 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=-6.7 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 Signed-off-by: Rodrigo Vivi --- tests/kms_sink_crc_basic.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/kms_sink_crc_basic.c b/tests/kms_sink_crc_basic.c index a7febe8..69329bd 100644 --- a/tests/kms_sink_crc_basic.c +++ b/tests/kms_sink_crc_basic.c @@ -48,9 +48,14 @@ typedef struct { igt_plane_t *primary; } data_t; -static void get_crc(char *crc) { +static void get_crc(data_t *data, char *crc) { int ret; - FILE *file = igt_debugfs_fopen("i915_sink_crc_eDP1", "r"); + FILE *file; + + igt_wait_for_vblank(data->drm_fd, 0); + igt_wait_for_vblank(data->drm_fd, 0); + + file = igt_debugfs_fopen("i915_sink_crc_eDP1", "r"); igt_require(file); ret = fscanf(file, "%s\n", crc); @@ -111,7 +116,7 @@ static void basic_sink_crc_check(data_t *data) igt_display_commit(&data->display); /* It should be Green */ - get_crc(crc); + get_crc(data, crc); assert_color(crc, GREEN); /* Go Red */ @@ -119,7 +124,7 @@ static void basic_sink_crc_check(data_t *data) igt_display_commit(&data->display); /* It should be Red */ - get_crc(crc); + get_crc(data, crc); assert_color(crc, RED); } @@ -136,7 +141,7 @@ static void run_test(data_t *data) c->connection != DRM_MODE_CONNECTED) continue; - igt_output_set_pipe(output, PIPE_ANY); + igt_output_set_pipe(output, 0); mode = igt_output_get_mode(output);