From patchwork Thu Oct 16 09:47:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 5089651 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BD9039F2BA for ; Thu, 16 Oct 2014 09:47:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0013720154 for ; Thu, 16 Oct 2014 09:47:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3CF0B201B9 for ; Thu, 16 Oct 2014 09:47:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9AEF66E193; Thu, 16 Oct 2014 02:47:36 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 93B676E193 for ; Thu, 16 Oct 2014 02:47:35 -0700 (PDT) Received: by mail-wi0-f171.google.com with SMTP id em10so975284wid.10 for ; Thu, 16 Oct 2014 02:47:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=ePOXVMM5iasuKRVwR6vNLngbrtxq2DyfGi1ArdVoidY=; b=byDYETzIQ9gSOu8hMKj9CICOUMx7rOqcvOKraxF3UFPEek+aX991k4ThYIcH3z005F Yx2/xntK3LbbIv5mdkISEnZIEbQgE7MV9nsIJfFxCzIjDXm9N1ztYc9IB70XZD1wilW2 64kF3/R6V572hgEoDkiLXNN9Y4jEXbYBlmM8zJChsMLWeWP5a2i5Qddn1N8Req3XZEkp mhSBCUmYbHVu8JTVPj4i7x3y2RewXZP84X3ejmNdjmxh6y1EHXuLeghpjBeQ98YFFYKN 4UeQtUWgq/tL4099btfQtZKwUeFA1ZEFKEI6hZYoF7fgL9+vx/aGwJVqPESfXPGdrDYO shlg== X-Gm-Message-State: ALoCoQn46DHs9ABI7Oog+4N4nq40u0cDOlWop5lNTxzp9O+WY9k3yQh215l7i4v19Xci0PRkxR1t X-Received: by 10.180.86.38 with SMTP id m6mr4272065wiz.65.1413452854162; Thu, 16 Oct 2014 02:47:34 -0700 (PDT) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id u7sm1359361wif.7.2014.10.16.02.47.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Oct 2014 02:47:33 -0700 (PDT) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Thu, 16 Oct 2014 10:47:31 +0100 Message-Id: <1413452851-31238-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.1.0 Subject: [Intel-gfx] [PATCH i-g-t] tests/kms_force_connector: fix assertion when VGA is already connected X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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, T_RP_MATCHES_RCVD,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 Compare the number of modes available when the edid is reset with the number before the edid was overridden. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82230 Signed-off-by: Thomas Wood --- tests/kms_force_connector.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index a6c4ce3..34c33b0 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -35,6 +35,7 @@ main (int argc, char **argv) drmModeRes *res; drmModeConnector *vga_connector, *temp; igt_display_t display; + int start_n_modes; igt_simple_init(argc, argv); @@ -61,6 +62,7 @@ main (int argc, char **argv) temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); igt_assert(temp->connection == DRM_MODE_CONNECTED); igt_assert(temp->count_modes > 0); + start_n_modes = temp->count_modes; drmModeFreeConnector(temp); /* attempt to use the display */ @@ -96,8 +98,9 @@ main (int argc, char **argv) /* remove edid */ kmstest_force_edid(drm_fd, vga_connector, NULL, 0); temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - /* the connector should now have the 5 default modes */ - igt_assert(temp->count_modes == 5); + /* the connector should now have the same number of modes that it + * started with */ + igt_assert(temp->count_modes == start_n_modes); drmModeFreeConnector(temp); /* force the connector off */