From patchwork Fri Jan 20 17:45:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 9529065 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C2FA36045F for ; Fri, 20 Jan 2017 17:46:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B55992868C for ; Fri, 20 Jan 2017 17:46:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA2FF286BD; Fri, 20 Jan 2017 17:46:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 569D62868C for ; Fri, 20 Jan 2017 17:46:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 311986EC27; Fri, 20 Jan 2017 17:46:43 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id EFA236EC20 for ; Fri, 20 Jan 2017 17:46:41 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: robertfoss) with ESMTPSA id 7E2E926855B From: Robert Foss To: intel-gfx@lists.freedesktop.org, Tomeu Vizoso , Maarten Lankhorst , Gustavo Padovan , Daniel Stone , Mika Kahola Date: Fri, 20 Jan 2017 12:45:25 -0500 Message-Id: <20170120174554.14195-4-robert.foss@collabora.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170120174554.14195-1-robert.foss@collabora.com> References: <20170120174554.14195-1-robert.foss@collabora.com> Subject: [Intel-gfx] [PATCH i-g-t v1 03/32] lib/igt_kms: Rename kmstest properties nplanes and plane 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-Virus-Scanned: ClamAV using ClamSMTP Rename these properties to have them use the same naming convention as the igt_*_t structs. Signed-off-by: Robert Foss Reviewed-by: Mika Kahola --- lib/igt_kms.c | 16 +++++++++------- lib/igt_kms.h | 4 ++-- tests/kms_plane_lowres.c | 10 +++++----- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 922bba63..8fa40c28 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1310,11 +1310,13 @@ void kmstest_get_crtc(enum pipe pipe, struct kmstest_crtc *crtc) crtc->active = true; parse_crtc(tmp, crtc); - crtc->nplanes = parse_planes(fid, NULL); - crtc->plane = calloc(crtc->nplanes, sizeof(*crtc->plane)); + crtc->n_planes = parse_planes(fid, NULL); + crtc->planes = calloc(crtc->n_planes, sizeof(*crtc->planes)); + igt_assert_f(crtc->planes, "Failed to allocate memory for %d planes\n", crtc->n_planes); + fseek(fid, 0, SEEK_END); fseek(fid, 0, SEEK_SET); - parse_planes(fid, crtc->plane); + parse_planes(fid, crtc->planes); if (crtc->pipe != pipe) crtc = NULL; @@ -1340,14 +1342,14 @@ void igt_assert_plane_visible(enum pipe pipe, bool visibility) kmstest_get_crtc(pipe, &crtc); visible = true; - for (i = 0; i < crtc.nplanes; i++) { - if (crtc.plane[i].type == DRM_PLANE_TYPE_PRIMARY) + for (i = 0; i < crtc.n_planes; i++) { + if (crtc.planes[i].type == DRM_PLANE_TYPE_PRIMARY) continue; - if (crtc.plane[i].pos_x > crtc.width) { + if (crtc.planes[i].pos_x > crtc.width) { visible = false; break; - } else if (crtc.plane[i].pos_y > crtc.height) { + } else if (crtc.planes[i].pos_y > crtc.height) { visible = false; break; } diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 44602fdd..859c79aa 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -149,8 +149,8 @@ struct kmstest_crtc { bool active; int width; int height; - int nplanes; - struct kmstest_plane *plane; + int n_planes; + struct kmstest_plane *planes; }; /** diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c index 858cc482..424ecb97 100644 --- a/tests/kms_plane_lowres.c +++ b/tests/kms_plane_lowres.c @@ -181,11 +181,11 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags, igt_output_set_pipe(output, pipe); kmstest_get_crtc(pipe, &crtc); - igt_skip_on(crtc.nplanes > data->display.pipes[pipe].n_planes); - igt_skip_on(crtc.nplanes == 0); + igt_skip_on(crtc.n_planes > data->display.pipes[pipe].n_planes); + igt_skip_on(crtc.n_planes == 0); - for (i = 0; i < crtc.nplanes; i++) - data->plane[i] = igt_output_get_plane(output, crtc.plane[i].index); + for (i = 0; i < crtc.n_planes; i++) + data->plane[i] = igt_output_get_plane(output, crtc.planes[i].index); mode = igt_output_get_mode(output); @@ -198,7 +198,7 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags, igt_plane_set_fb(data->plane[0], &data->fb[0]); /* yellow sprite plane in lower left corner */ - for (i = IGT_PLANE_2; i < crtc.nplanes; i++) { + for (i = IGT_PLANE_2; i < crtc.n_planes; i++) { if (data->plane[i]->is_cursor) size = 64; else