From patchwork Tue Apr 19 11:40:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8879071 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1D693BF440 for ; Tue, 19 Apr 2016 11:41:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CFA6520145 for ; Tue, 19 Apr 2016 11:41:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6847A2027D for ; Tue, 19 Apr 2016 11:41:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 492446E74E; Tue, 19 Apr 2016 11:41:28 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id C3DC36E740 for ; Tue, 19 Apr 2016 11:40:47 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id y144so4362842wmd.0 for ; Tue, 19 Apr 2016 04:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=BQuKZMdUiDuGcimq47Fb2Y4720wzRX9pyL/DubEi25o=; b=cfVW0h+b0JbVbMKoOuRDsQNZOhcuOPMf9GkH1haOS8NiXC9O6VeX94bZkEae1MoLbQ pj6LYqes/bda+MbcxTRcmyqMSrqKUopxrdKoA9Xoh7pbCt+TxD8BOEdvQbm0UeMnzi1N 0j8w5VI27srNE0FMwLvmRf6RL7vZLPOrdJijeRoD16Y8rcSLgX4OazQloJOl1BhXwgSZ nLpFC8tSo+w1iLDchKxwFI2fNUUKdI4KnsRueY2F2gyl0Uon+qeQxFPIrfYoumAdSULI IxkmwRqVXMhqP95dewIhFhzrbRsbj3oTbLmm3B8ZGQ5OxPe56eiwNj/zeKnvJRpfX49S whvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=BQuKZMdUiDuGcimq47Fb2Y4720wzRX9pyL/DubEi25o=; b=biGQnYMYcc2XmkTKKMMEGLn7DHMQTxqDhfjNiJYpYGGylt4njum5QpmOGmfDuNLVNf J3P5h/D+Z30c/Ti5y7zABiqFaRvzt06QsiS/4Pcol0HJStZJB/PeEIMtC4SwNt1jtVbT WLbRyH3gpsVMz0dYj84zWwshbA2CmVJbNxXQzSVnSy18zF9V4k6ZG6+KkEPmWaXclc4P 2wZywF6YQYNTcw0ne34tH2jFSo4RJ2QjDSNFBzTtGMGAOYDz2Ov/Y8Gg3XiXJ0IdyMoz NQ85/iLdPuMrI/dllR68bkTDCOpmAIk5HQ+nslfQjpSFYMk99yEfmQDAgJhW+F2cTZU9 p+HA== X-Gm-Message-State: AOPr4FUF7sbYzm+vyeBQX38CgxV9+pnoBw8qRo9slhw6QXNqHDx7Yv20zEb9jt2uir9FRw== X-Received: by 10.28.141.18 with SMTP id p18mr3069033wmd.57.1461066046029; Tue, 19 Apr 2016 04:40:46 -0700 (PDT) Received: from cizrna.lan ([109.72.12.68]) by smtp.gmail.com with ESMTPSA id g78sm3860424wme.21.2016.04.19.04.40.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Apr 2016 04:40:45 -0700 (PDT) From: Tomeu Vizoso To: Intel GFX discussion Date: Tue, 19 Apr 2016 13:40:27 +0200 Message-Id: <1461066028-30499-2-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1461066028-30499-1-git-send-email-tomeu.vizoso@collabora.com> References: <1461066028-30499-1-git-send-email-tomeu.vizoso@collabora.com> Cc: Daniel Stone , Tomeu Vizoso , Micah Fedke , Gustavo Padovan , Emil Velikov Subject: [Intel-gfx] [i-g-t PATCH v1 1/2] lib: Remove superfluous kmstest_connector_config.pipe 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=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 The field pipe in struct kmstest_connector_config is superfluous because there's already crtc_idx which should contain always the same value. By dropping the original assignment to the field pipe, we can also drop a call to DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID which is problematic when running the tests on drivers other than i915. Signed-off-by: Tomeu Vizoso --- lib/igt_kms.c | 24 +++++++++++------------- lib/igt_kms.h | 1 - tests/kms_crtc_background_color.c | 2 +- tests/kms_flip.c | 10 +++++----- tests/kms_flip_tiling.c | 2 +- tests/kms_panel_fitting.c | 2 +- tests/kms_plane_scaling.c | 2 +- tests/kms_render.c | 2 +- tests/testdisplay.c | 1 - 9 files changed, 21 insertions(+), 25 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 8f30c94070d5..40cb317e99b9 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -822,8 +822,6 @@ found: config->encoder = encoder; config->crtc = drmModeGetCrtc(drm_fd, resources->crtcs[i]); config->crtc_idx = i; - config->pipe = kmstest_get_pipe_from_crtc_id(drm_fd, - config->crtc->crtc_id); drmModeFreeResources(resources); @@ -1167,9 +1165,9 @@ static void igt_output_refresh(igt_output_t *output) } LOG(display, "%s: Selecting pipe %s\n", output->name, - kmstest_pipe_name(output->config.pipe)); + kmstest_pipe_name(output->config.crtc_idx)); - display->pipes_in_use |= 1 << output->config.pipe; + display->pipes_in_use |= 1 << output->config.crtc_idx; igt_atomic_fill_props(display, output, IGT_NUM_CRTC_PROPS, igt_crtc_prop_names, IGT_NUM_CONNECTOR_PROPS, igt_connector_prop_names); } @@ -1540,7 +1538,7 @@ static igt_pipe_t *igt_output_get_driving_pipe(igt_output_t *output) * The user hasn't specified a pipe to use, take the one * configured by the last refresh() */ - pipe = output->config.pipe; + pipe = output->config.crtc_idx; } else { /* * Otherwise, return the pending pipe (ie the pipe that should @@ -1628,7 +1626,7 @@ igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_output_t *output, LOG(display, "%s: populating plane data: %s.%d, fb %u\n", igt_output_name(output), - kmstest_pipe_name(output->config.pipe), + kmstest_pipe_name(output->config.crtc_idx), plane->index, fb_id); @@ -1711,7 +1709,7 @@ static int igt_drm_plane_commit(igt_plane_t *plane, LOG(display, "%s: SetPlane pipe %s, plane %d, disabling\n", igt_output_name(output), - kmstest_pipe_name(output->config.pipe), + kmstest_pipe_name(output->config.crtc_idx), plane->index); ret = drmModeSetPlane(display->drm_fd, @@ -1742,7 +1740,7 @@ static int igt_drm_plane_commit(igt_plane_t *plane, "%s: SetPlane %s.%d, fb %u, src = (%d, %d) " "%ux%u dst = (%u, %u) %ux%u\n", igt_output_name(output), - kmstest_pipe_name(output->config.pipe), + kmstest_pipe_name(output->config.crtc_idx), plane->index, fb_id, src_x >> 16, src_y >> 16, src_w >> 16, src_h >> 16, @@ -1797,7 +1795,7 @@ static int igt_cursor_commit_legacy(igt_plane_t *cursor, LOG(display, "%s: SetCursor pipe %s, fb %u %dx%d\n", igt_output_name(output), - kmstest_pipe_name(output->config.pipe), + kmstest_pipe_name(output->config.crtc_idx), gem_handle, cursor->crtc_w, cursor->crtc_h); @@ -1809,7 +1807,7 @@ static int igt_cursor_commit_legacy(igt_plane_t *cursor, LOG(display, "%s: SetCursor pipe %s, disabling\n", igt_output_name(output), - kmstest_pipe_name(output->config.pipe)); + kmstest_pipe_name(output->config.crtc_idx)); ret = drmModeSetCursor(display->drm_fd, crtc_id, 0, 0, 0); @@ -1827,7 +1825,7 @@ static int igt_cursor_commit_legacy(igt_plane_t *cursor, LOG(display, "%s: MoveCursor pipe %s, (%d, %d)\n", igt_output_name(output), - kmstest_pipe_name(output->config.pipe), + kmstest_pipe_name(output->config.crtc_idx), x, y); ret = drmModeMoveCursor(display->drm_fd, crtc_id, x, y); @@ -1874,7 +1872,7 @@ static int igt_primary_plane_commit_legacy(igt_plane_t *primary, "%s: SetCrtc pipe %s, fb %u, panning (%d, %d), " "mode %dx%d\n", igt_output_name(output), - kmstest_pipe_name(output->config.pipe), + kmstest_pipe_name(output->config.crtc_idx), fb_id, primary->pan_x, primary->pan_y, mode->hdisplay, mode->vdisplay); @@ -1890,7 +1888,7 @@ static int igt_primary_plane_commit_legacy(igt_plane_t *primary, LOG(display, "%s: SetCrtc pipe %s, disabling\n", igt_output_name(output), - kmstest_pipe_name(output->config.pipe)); + kmstest_pipe_name(output->config.crtc_idx)); ret = drmModeSetCrtc(display->drm_fd, crtc_id, diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 2c189ed47d04..f2444dd74ffe 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -132,7 +132,6 @@ struct kmstest_connector_config { uint32_t atomic_props_crtc[IGT_NUM_CRTC_PROPS]; uint32_t atomic_props_connector[IGT_NUM_CONNECTOR_PROPS]; int crtc_idx; - int pipe; }; /** diff --git a/tests/kms_crtc_background_color.c b/tests/kms_crtc_background_color.c index b496625c1693..57e7d4a1f0ad 100644 --- a/tests/kms_crtc_background_color.c +++ b/tests/kms_crtc_background_color.c @@ -136,7 +136,7 @@ static void test_crtc_background(data_t *data) for_each_connected_output(display, output) { igt_plane_t *plane; - pipe = output->config.pipe; + pipe = output->config.crtc_idx; igt_output_set_pipe(output, pipe); plane = igt_output_get_plane(output, IGT_PLANE_PRIMARY); diff --git a/tests/kms_flip.c b/tests/kms_flip.c index 3d4454407709..660ec6f1135e 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -1042,11 +1042,11 @@ static void connector_find_preferred_mode(uint32_t connector_id, int crtc_idx, return; } - o->pipe = config.pipe; + o->pipe = config.crtc_idx; o->kconnector[0] = config.connector; o->kencoder[0] = config.encoder; o->_crtc[0] = config.crtc->crtc_id; - o->_pipe[0] = config.pipe; + o->_pipe[0] = config.crtc_idx; o->kmode[0] = config.default_mode; o->mode_valid = 1; @@ -1107,7 +1107,7 @@ static void connector_find_compatible_mode(int crtc_idx0, int crtc_idx1, } found: - o->pipe = config[0].pipe; + o->pipe = config[0].crtc_idx; o->fb_width = mode[0]->hdisplay; o->fb_height = mode[0]->vdisplay; o->mode_valid = 1; @@ -1115,13 +1115,13 @@ found: o->kconnector[0] = config[0].connector; o->kencoder[0] = config[0].encoder; o->_crtc[0] = config[0].crtc->crtc_id; - o->_pipe[0] = config[0].pipe; + o->_pipe[0] = config[0].crtc_idx; o->kmode[0] = *mode[0]; o->kconnector[1] = config[1].connector; o->kencoder[1] = config[1].encoder; o->_crtc[1] = config[1].crtc->crtc_id; - o->_pipe[1] = config[1].pipe; + o->_pipe[1] = config[1].crtc_idx; o->kmode[1] = *mode[1]; drmModeFreeCrtc(config[0].crtc); diff --git a/tests/kms_flip_tiling.c b/tests/kms_flip_tiling.c index f58e65be61ee..9056c7ed1116 100644 --- a/tests/kms_flip_tiling.c +++ b/tests/kms_flip_tiling.c @@ -89,7 +89,7 @@ test_flip_tiling(data_t *data, igt_output_t *output, uint64_t tiling[2]) igt_crc_t reference_crc, crc; int fb_id, pipe, ret, width; - pipe = output->config.pipe; + pipe = output->config.crtc_idx; pipe_crc = pipe_crc_new(pipe); igt_output_set_pipe(output, pipe); diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 829d9cdd0631..5a22e47e3a61 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -153,7 +153,7 @@ static void test_panel_fitting(data_t *d) igt_require(output->config.connector->connector_type == DRM_MODE_CONNECTOR_eDP); - pipe = output->config.pipe; + pipe = output->config.crtc_idx; igt_output_set_pipe(output, pipe); mode = igt_output_get_mode(output); diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c index ad5404d90bfa..07c581caef12 100644 --- a/tests/kms_plane_scaling.c +++ b/tests/kms_plane_scaling.c @@ -189,7 +189,7 @@ static void test_plane_scaling(data_t *d) for_each_connected_output(display, output) { drmModeModeInfo *mode; - pipe = output->config.pipe; + pipe = output->config.crtc_idx; igt_output_set_pipe(output, pipe); mode = igt_output_get_mode(output); diff --git a/tests/kms_render.c b/tests/kms_render.c index e0a2b58f6b82..d08b7ce0e72b 100644 --- a/tests/kms_render.c +++ b/tests/kms_render.c @@ -109,7 +109,7 @@ static int test_format(const char *test_name, mode->name, mode->vrefresh, igt_format_str(format)); igt_assert_lt(0, ret); ret = asprintf(&cconf_str, "pipe %s, encoder %s, connector %s", - kmstest_pipe_name(cconf->pipe), + kmstest_pipe_name(cconf->crtc_idx), kmstest_encoder_type_str(cconf->encoder->encoder_type), kmstest_connector_type_str(cconf->connector->connector_type)); igt_assert_lt(0, ret); diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 00b47bd06280..98455fbf42b1 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -212,7 +212,6 @@ static void connector_find_preferred_mode(uint32_t connector_id, c->encoder = config.encoder; c->crtc = config.crtc->crtc_id; c->crtc_idx = config.crtc_idx; - c->pipe = config.pipe; if (mode_num != -1) { igt_assert(mode_num < config.connector->count_modes);