From: Daniel Vetter Subject: [PATCH 1/2] tests: use "auto" pipe CRC source Date: Thu, 31 Oct 2013 15:52:29 +0100 Message-ID: <1383231150-13133-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f178.google.com (mail-ea0-f178.google.com [209.85.215.178]) by gabe.freedesktop.org (Postfix) with ESMTP id 76A61EFE02 for ; Thu, 31 Oct 2013 07:52:39 -0700 (PDT) Received: by mail-ea0-f178.google.com with SMTP id a15so1469995eae.9 for ; Thu, 31 Oct 2013 07:52:38 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Intel Graphics Development Cc: Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org Makes stuff work on DP ports on gmch platforms automatically. Cc: Damien Lespiau Signed-off-by: Daniel Vetter --- lib/igt_debugfs.c | 3 ++- lib/igt_debugfs.h | 1 + tests/debugfs_pipe_crc.c | 11 +++-------- tests/kms_cursor_crc.c | 12 ++---------- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index dc4a0a2..7efb415 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -154,7 +154,8 @@ static const char *pipe_crc_sources[] = { "TV", "DP-B", "DP-C", - "DP-D" + "DP-D", + "auto" }; static const char *pipe_crc_source_name(enum intel_pipe_crc_source source) diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h index f2873e0..4e82a2c 100644 --- a/lib/igt_debugfs.h +++ b/lib/igt_debugfs.h @@ -55,6 +55,7 @@ enum intel_pipe_crc_source { INTEL_PIPE_CRC_SOURCE_DP_B, INTEL_PIPE_CRC_SOURCE_DP_C, INTEL_PIPE_CRC_SOURCE_DP_D, + INTEL_PIPE_CRC_SOURCE_AUTO, INTEL_PIPE_CRC_SOURCE_MAX, }; diff --git a/tests/debugfs_pipe_crc.c b/tests/debugfs_pipe_crc.c index 1bb34dc..5ffa3c9 100644 --- a/tests/debugfs_pipe_crc.c +++ b/tests/debugfs_pipe_crc.c @@ -169,17 +169,12 @@ static void test_read_crc(data_t *data, int pipe, unsigned flags) pipe_crc = igt_pipe_crc_new(&data->debugfs, data->drm_fd, connector->config.pipe, - INTEL_PIPE_CRC_SOURCE_PLANE1); + INTEL_PIPE_CRC_SOURCE_AUTO); connector_set_mode(data, connector, &connector->config.default_mode); - if (!pipe_crc || !igt_pipe_crc_start(pipe_crc)) { - igt_pipe_crc_free(pipe_crc); - pipe_crc = igt_pipe_crc_new(&data->debugfs, data->drm_fd, - connector->config.pipe, - INTEL_PIPE_CRC_SOURCE_PIPE); - igt_assert(igt_pipe_crc_start(pipe_crc)); - } + igt_require(pipe_crc); + igt_assert(igt_pipe_crc_start(pipe_crc)); /* wait for 3 vblanks and the corresponding 3 CRCs */ igt_pipe_crc_get_crcs(pipe_crc, 3, &crcs); diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c index 3828ac3..55b9b7c 100644 --- a/tests/kms_cursor_crc.c +++ b/tests/kms_cursor_crc.c @@ -110,16 +110,8 @@ static igt_pipe_crc_t *create_crc(data_t *data, int crtc_idx) igt_pipe_crc_t *crc; crc = igt_pipe_crc_new(&data->debugfs, data->drm_fd, crtc_idx, - INTEL_PIPE_CRC_SOURCE_PF); - if (crc) - return crc; - - crc = igt_pipe_crc_new(&data->debugfs, data->drm_fd, crtc_idx, - INTEL_PIPE_CRC_SOURCE_PIPE); - if (crc) - return crc; - - return NULL; + INTEL_PIPE_CRC_SOURCE_AUTO); + return crc; } static void display_init(data_t *data) -- 1.8.4.rc3