From patchwork Fri Jan 20 17:45:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 9529061 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 8B7136045F for ; Fri, 20 Jan 2017 17:46:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E15B2868C for ; Fri, 20 Jan 2017 17:46:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72BAF286BC; Fri, 20 Jan 2017 17:46:41 +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 153052868C for ; Fri, 20 Jan 2017 17:46:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1C62E6EC19; Fri, 20 Jan 2017 17:46:40 +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 2CF666EC19 for ; Fri, 20 Jan 2017 17:46:38 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: robertfoss) with ESMTPSA id 21DB32603D9 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:23 -0500 Message-Id: <20170120174554.14195-2-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 01/32] lib/igt_kms: Add index property to kmstest_plane struct 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 Add an index property which helps accessing the corresponding igt_plane_t structure through the igt_*_get_plane() functions. Signed-off-by: Robert Foss Reviewed-by: Mika Kahola --- lib/igt_kms.c | 12 ++++++------ lib/igt_kms.h | 1 + tests/kms_plane_lowres.c | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index d104734a..e1abcf0d 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1244,21 +1244,21 @@ static int parse_planes(FILE *fid, struct kmstest_plane *plane) { char tmp[256]; int nplanes; - int ovl; - ovl = 0; nplanes = 0; while (fgets(tmp, 256, fid) != NULL) { igt_assert_neq(nplanes, IGT_MAX_PLANES); if (strstr(tmp, "type=PRI") != NULL) { - get_plane(tmp, IGT_PLANE_PRIMARY, &plane[nplanes]); + get_plane(tmp, DRM_PLANE_TYPE_PRIMARY, &plane[nplanes]); + plane[nplanes].index = nplanes; nplanes++; } else if (strstr(tmp, "type=OVL") != NULL) { - get_plane(tmp, IGT_PLANE_2 + ovl, &plane[nplanes]); - ovl++; + get_plane(tmp, DRM_PLANE_TYPE_OVERLAY, &plane[nplanes]); + plane[nplanes].index = nplanes; nplanes++; } else if (strstr(tmp, "type=CUR") != NULL) { - get_plane(tmp, IGT_PLANE_CURSOR, &plane[nplanes]); + get_plane(tmp, DRM_PLANE_TYPE_CURSOR, &plane[nplanes]); + plane[nplanes].index = nplanes; nplanes++; break; } diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 64414a24..d6cf8338 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -136,6 +136,7 @@ struct kmstest_connector_config { struct kmstest_plane { int id; int plane; + int index; int pos_x; int pos_y; int width; diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c index 93aefdaa..858cc482 100644 --- a/tests/kms_plane_lowres.c +++ b/tests/kms_plane_lowres.c @@ -185,7 +185,7 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags, igt_skip_on(crtc.nplanes == 0); for (i = 0; i < crtc.nplanes; i++) - data->plane[i] = igt_output_get_plane(output, crtc.plane[i].plane); + data->plane[i] = igt_output_get_plane(output, crtc.plane[i].index); mode = igt_output_get_mode(output);