From patchwork Fri Feb 26 19:39:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zanoni, Paulo R" X-Patchwork-Id: 8441481 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DFEF29F314 for ; Fri, 26 Feb 2016 19:40:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21E47203A1 for ; Fri, 26 Feb 2016 19:40:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 34B33203A9 for ; Fri, 26 Feb 2016 19:40:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 53A216EB81; Fri, 26 Feb 2016 19:40:15 +0000 (UTC) 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 70CEF6EB40 for ; Fri, 26 Feb 2016 19:40:13 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 26 Feb 2016 11:40:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,504,1449561600"; d="scan'208";a="659878528" Received: from jholm-mobl.amr.corp.intel.com (HELO panetone.amr.corp.intel.com) ([10.252.138.60]) by FMSMGA003.fm.intel.com with ESMTP; 26 Feb 2016 11:40:12 -0800 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Fri, 26 Feb 2016 16:39:55 -0300 Message-Id: <1456515598-23493-2-git-send-email-paulo.r.zanoni@intel.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456515598-23493-1-git-send-email-paulo.r.zanoni@intel.com> References: <1456515598-23493-1-git-send-email-paulo.r.zanoni@intel.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH igt 2/5] kms_frontbuffer_tracking: don't pass the crtc idx to init_mode_params 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=-4.2 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 already pass the crtc id, so use the id to retrieve the index. We'll change the way we pass the crtc id in the next commits, so we'll have to call a function to calculate the index based on the id at that point. Do the change now in order to avoid big commits later. Signed-off-by: Paulo Zanoni --- tests/kms_frontbuffer_tracking.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 88bf5a5..d641cc7 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -368,14 +368,14 @@ static void print_mode_info(const char *screen, struct modeset_params *params) } static void init_mode_params(struct modeset_params *params, uint32_t crtc_id, - int crtc_index, uint32_t connector_id, - drmModeModeInfoPtr mode) + uint32_t connector_id, drmModeModeInfoPtr mode) { uint32_t plane_id = 0; + int crtc_idx = kmstest_get_crtc_idx(drm.res, crtc_id); int i; for (i = 0; i < drm.plane_res->count_planes && plane_id == 0; i++) - if ((drm.planes[i]->possible_crtcs & (1 << crtc_index)) && + if ((drm.planes[i]->possible_crtcs & (1 << crtc_idx)) && drm.plane_types[i] == DRM_PLANE_TYPE_OVERLAY) plane_id = drm.planes[i]->plane_id; @@ -465,7 +465,7 @@ static bool init_modeset_cached_params(void) if (!prim_connector_id) return false; - init_mode_params(&prim_mode_params, drm.res->crtcs[0], 0, + init_mode_params(&prim_mode_params, drm.res->crtcs[0], prim_connector_id, prim_mode); print_mode_info("Primary", &prim_mode_params); @@ -475,7 +475,7 @@ static bool init_modeset_cached_params(void) } igt_assert(drm.res->count_crtcs >= 2); - init_mode_params(&scnd_mode_params, drm.res->crtcs[1], 1, + init_mode_params(&scnd_mode_params, drm.res->crtcs[1], scnd_connector_id, scnd_mode); print_mode_info("Secondary", &scnd_mode_params);