From patchwork Sat Nov 21 02:58:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Kasireddy X-Patchwork-Id: 7673291 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 1736ABF90C for ; Sat, 21 Nov 2015 03:01:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43E492045B for ; Sat, 21 Nov 2015 03:01:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 659BD20457 for ; Sat, 21 Nov 2015 03:01:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C0BC06E54F; Fri, 20 Nov 2015 19:01:48 -0800 (PST) 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 0D0F96E54F for ; Fri, 20 Nov 2015 19:01:48 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 20 Nov 2015 19:01:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,326,1444719600"; d="scan'208";a="856470476" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by fmsmga002.fm.intel.com with ESMTP; 20 Nov 2015 19:01:44 -0800 Received: from vkasired-desk2.fm.intel.com (10.22.254.138) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 20 Nov 2015 19:01:44 -0800 From: Vivek Kasireddy To: Date: Fri, 20 Nov 2015 18:58:04 -0800 Message-ID: <1448074684-8719-1-git-send-email-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.22.254.138] Cc: Vivek Kasireddy Subject: [Intel-gfx] [PATCH i-g-t] tests/kms_rotation_crc: Use get_first_connected_output macro 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: , 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 In some cases, the only connected connector might not occupy the first slot and hence output[0] might be empty. Therefore, use the get_first_connected_output macro to find the output object associated with the connected connector. Signed-off-by: Vivek Kasireddy --- tests/kms_rotation_crc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c index c3241cf..94b4486 100644 --- a/tests/kms_rotation_crc.c +++ b/tests/kms_rotation_crc.c @@ -323,14 +323,15 @@ static void test_plane_rotation_ytiled_obj(data_t *data, enum igt_plane plane_ty int bpp = igt_drm_format_to_bpp(format); enum igt_commit_style commit = COMMIT_LEGACY; int fd = data->gfx_fd; - igt_output_t *output = &display->outputs[0]; + igt_output_t *output = NULL; igt_plane_t *plane; drmModeModeInfo *mode; unsigned int stride, size, w, h; uint32_t gem_handle; int ret; - igt_require(output != NULL && output->valid == true); + get_first_connected_output(display, output); + igt_require(output != NULL); plane = igt_output_get_plane(output, plane_type); igt_require(igt_plane_supports_rotation(plane)); @@ -385,7 +386,7 @@ static void test_plane_rotation_exhaust_fences(data_t *data, enum igt_plane plan int bpp = igt_drm_format_to_bpp(format); enum igt_commit_style commit = COMMIT_LEGACY; int fd = data->gfx_fd; - igt_output_t *output = &display->outputs[0]; + igt_output_t *output = NULL; igt_plane_t *plane; drmModeModeInfo *mode; data_t data2[MAX_FENCES+1] = {}; @@ -394,7 +395,8 @@ static void test_plane_rotation_exhaust_fences(data_t *data, enum igt_plane plan uint64_t total_aperture_size, total_fbs_size; int i, ret; - igt_require(output != NULL && output->valid == true); + get_first_connected_output(display, output); + igt_require(output != NULL); plane = igt_output_get_plane(output, plane_type); igt_require(igt_plane_supports_rotation(plane));