From patchwork Wed Apr 2 11:06:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Antti_Koskip=C3=A4=C3=A4?= X-Patchwork-Id: 3928161 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 B03FC9F38E for ; Wed, 2 Apr 2014 11:07:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E165A2025A for ; Wed, 2 Apr 2014 11:07:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D51CB20266 for ; Wed, 2 Apr 2014 11:07:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D13276EA61; Wed, 2 Apr 2014 04:07:23 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id C3D146EA60 for ; Wed, 2 Apr 2014 04:07:22 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 02 Apr 2014 04:07:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,779,1389772800"; d="scan'208";a="512776528" Received: from unknown (HELO sahapukki.fi.intel.com) ([10.237.72.180]) by fmsmga002.fm.intel.com with ESMTP; 02 Apr 2014 04:06:29 -0700 From: Antti Koskipaa To: intel-gfx@lists.freedesktop.org Date: Wed, 2 Apr 2014 14:06:25 +0300 Message-Id: <1396436790-14313-3-git-send-email-antti.koskipaa@linux.intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1396436790-14313-1-git-send-email-antti.koskipaa@linux.intel.com> References: <1396436790-14313-1-git-send-email-antti.koskipaa@linux.intel.com> Subject: [Intel-gfx] [PATCH i-g-t 2/7] kms_cursor_crc: Move cursor enable and disable calls where they belong 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=-4.8 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 We can't have the hw cursor enabled during software render tests. Signed-off-by: Antti Koskipaa --- tests/kms_cursor_crc.c | 54 ++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c index 52281d0..8802da6 100644 --- a/tests/kms_cursor_crc.c +++ b/tests/kms_cursor_crc.c @@ -67,6 +67,30 @@ static void draw_cursor(cairo_t *cr, int x, int y, int w) igt_paint_color_alpha(cr, x + w, y + w, w, w, 0.5, 0.5, 0.5, 1.0); } +static void cursor_enable(test_data_t *test_data) +{ + data_t *data = test_data->data; + igt_display_t *display = &data->display; + igt_output_t *output = test_data->output; + igt_plane_t *cursor; + + cursor = igt_output_get_plane(output, IGT_PLANE_CURSOR); + igt_plane_set_fb(cursor, &data->fb); + igt_display_commit(display); +} + +static void cursor_disable(test_data_t *test_data) +{ + data_t *data = test_data->data; + igt_display_t *display = &data->display; + igt_output_t *output = test_data->output; + igt_plane_t *cursor; + + cursor = igt_output_get_plane(output, IGT_PLANE_CURSOR); + igt_plane_set_fb(cursor, NULL); + igt_display_commit(display); +} + static igt_pipe_crc_t *create_crc(data_t *data, enum pipe pipe) { igt_pipe_crc_t *crc; @@ -85,10 +109,12 @@ static void do_single_test(test_data_t *test_data, int x, int y) printf("."); fflush(stdout); + cursor_enable(test_data); cursor = igt_output_get_plane(test_data->output, IGT_PLANE_CURSOR); igt_plane_set_position(cursor, x, y); igt_display_commit(display); igt_wait_for_vblank(data->drm_fd, test_data->pipe); + cursor_disable(test_data); igt_pipe_crc_collect_crc(pipe_crc, &crc); if (test_data->crc_must_match) @@ -106,30 +132,6 @@ static void do_test(test_data_t *test_data, do_single_test(test_data, left, bottom); } -static void cursor_enable(test_data_t *test_data) -{ - data_t *data = test_data->data; - igt_display_t *display = &data->display; - igt_output_t *output = test_data->output; - igt_plane_t *cursor; - - cursor = igt_output_get_plane(output, IGT_PLANE_CURSOR); - igt_plane_set_fb(cursor, &data->fb); - igt_display_commit(display); -} - -static void cursor_disable(test_data_t *test_data) -{ - data_t *data = test_data->data; - igt_display_t *display = &data->display; - igt_output_t *output = test_data->output; - igt_plane_t *cursor; - - cursor = igt_output_get_plane(output, IGT_PLANE_CURSOR); - igt_plane_set_fb(cursor, NULL); - igt_display_commit(display); -} - static void test_crc(test_data_t *test_data, bool onscreen, int cursor_w, int cursor_h) { @@ -138,8 +140,6 @@ static void test_crc(test_data_t *test_data, int top = test_data->top; int bottom = test_data->bottom; - cursor_enable(test_data); - if (onscreen) { /* cursor onscreen, crc should match, except when white visible cursor is used */ test_data->crc_must_match = false; @@ -183,8 +183,6 @@ static void test_crc(test_data_t *test_data, /* go nuts */ do_test(test_data, INT_MIN, INT_MAX, INT_MIN, INT_MAX); } - - cursor_disable(test_data); } static bool prepare_crtc(test_data_t *test_data, igt_output_t *output,