From patchwork Fri Dec 1 12:43:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Hiler X-Patchwork-Id: 10087015 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 015E4603B4 for ; Fri, 1 Dec 2017 12:44:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3F622A476 for ; Fri, 1 Dec 2017 12:44:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8E112A525; Fri, 1 Dec 2017 12:44:21 +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 71B8B2A476 for ; Fri, 1 Dec 2017 12:44:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2396D6ECF6; Fri, 1 Dec 2017 12:44:21 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id D9C0D6ECF6 for ; Fri, 1 Dec 2017 12:44:19 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2017 04:44:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,344,1508828400"; d="scan'208";a="11853306" Received: from ahiler-desk1.fi.intel.com ([10.237.68.151]) by orsmga001.jf.intel.com with ESMTP; 01 Dec 2017 04:44:17 -0800 From: Arkadiusz Hiler To: intel-gfx@lists.freedesktop.org Date: Fri, 1 Dec 2017 14:43:51 +0200 Message-Id: <20171201124351.5306-1-arkadiusz.hiler@intel.com> X-Mailer: git-send-email 2.13.6 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH i-g-t] test/kms_plane_lowres: Fix display_commit_mode() so it returns the crc 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-Virus-Scanned: ClamAV using ClamSMTP Compiler complained on crc_lowres and crc_hires2 being uninitialized and indeed, display_commit_mode() seems to have intention of retruning the value through the parameter that is only a single pointer. This couses only the local copy of the pointer, the one inside display_commit_mode(), to be overwritten. Let's fix that! Also add missing hires crc comparison (M. Kahola). Cc: Mika Kahola Cc: Maarten Lankhorst Signed-off-by: Arkadiusz Hiler --- tests/kms_plane_lowres.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c index 85d3145d..9cc9724c 100644 --- a/tests/kms_plane_lowres.c +++ b/tests/kms_plane_lowres.c @@ -127,7 +127,7 @@ test_fini(data_t *data, igt_output_t *output, enum pipe pipe) static int display_commit_mode(igt_display_t *display, igt_pipe_crc_t *pipe_crc, - enum pipe pipe, int flags, igt_crc_t *crc) + enum pipe pipe, int flags, igt_crc_t **crc) { char buf[256]; struct drm_event *e = (void *)buf; @@ -148,7 +148,7 @@ display_commit_mode(igt_display_t *display, igt_pipe_crc_t *pipe_crc, igt_assert_eq(e->type, DRM_EVENT_FLIP_COMPLETE); igt_reset_timeout(); - n = igt_pipe_crc_get_crcs(pipe_crc, vblank_stop - vblank_start, &crc); + n = igt_pipe_crc_get_crcs(pipe_crc, vblank_stop - vblank_start, crc); igt_assert_eq(n, vblank_stop - vblank_start); return n; @@ -252,7 +252,8 @@ test_plane_position_with_output(data_t *data, enum pipe pipe, check_mode(&mode_lowres, mode2); - display_commit_mode(&data->display, pipe_crc, pipe, flags, crc_lowres); + display_commit_mode(&data->display, pipe_crc, pipe, flags, &crc_lowres); + free(crc_lowres); igt_assert_plane_visible(data->drm_fd, pipe, false); @@ -264,10 +265,15 @@ test_plane_position_with_output(data_t *data, enum pipe pipe, check_mode(mode1, mode3); - display_commit_mode(&data->display, pipe_crc, pipe, flags, crc_hires2); + display_commit_mode(&data->display, pipe_crc, pipe, flags, &crc_hires2); igt_assert_plane_visible(data->drm_fd, pipe, true); + igt_assert_crc_equal(crc_hires1, crc_hires2); + + free(crc_hires1); + free(crc_hires2); + igt_pipe_crc_stop(pipe_crc); igt_pipe_crc_free(pipe_crc);