From patchwork Mon Dec 30 15:56:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 3419751 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 994AC9F37A for ; Mon, 30 Dec 2013 15:57:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 064B320109 for ; Mon, 30 Dec 2013 15:57:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1FC6820107 for ; Mon, 30 Dec 2013 15:57:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 66B14FAD08; Mon, 30 Dec 2013 07:57:33 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qa0-f48.google.com (mail-qa0-f48.google.com [209.85.216.48]) by gabe.freedesktop.org (Postfix) with ESMTP id A4B57FA230 for ; Mon, 30 Dec 2013 07:57:17 -0800 (PST) Received: by mail-qa0-f48.google.com with SMTP id w5so10851697qac.14 for ; Mon, 30 Dec 2013 07:57:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sA8ZMTIQmxwgyD3GevYC1FfHWrnWjsyi9qLwapNMStc=; b=OG+TFDW6kVBkDkGEwrlF43cJGFazBFacRZovMypar2I1TjlZXt4pynfU2PNVFhyrVD B5Q/WFUXwrOTCjj7hQ31t4D4AuGfoprzyl2CfOklbNXCP1S6guazLVJ5JPgDMMexCErG avrIAal5YDpWUF256nn1QyKZhLNMRstrmbCACyIGcdGdedaa7uGh5I9PqJZaW9cRBbNF 0cNvNHK6hIk9Pw/HWQdpp2iiRMc8Vbv2DFKxBONQZkLJL0hnDLhVW10BX2sXg7doyxbS YBn7M5sC81/C+zwJsI6hj7PHPHzw7kn0qf2JTK8tnDS4pCi2dDxRks1l3Ahx/wZHQslp w1gg== X-Received: by 10.229.7.133 with SMTP id d5mr108502396qcd.10.1388419037252; Mon, 30 Dec 2013 07:57:17 -0800 (PST) Received: from localhost.localdomain ([187.112.58.219]) by mx.google.com with ESMTPSA id o3sm66129491qak.5.2013.12.30.07.57.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Dec 2013 07:57:16 -0800 (PST) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Mon, 30 Dec 2013 13:56:53 -0200 Message-Id: <1388419013-17016-6-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1388419013-17016-1-git-send-email-przanoni@gmail.com> References: <1388419013-17016-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 6/6] tests/kms_flip: free the test_output struct when counting modes X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Paulo Zanoni Looks like we have to do a lot of work just to count the number of modes... Caught by Valgrind. Signed-off-by: Paulo Zanoni --- tests/kms_flip.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/kms_flip.c b/tests/kms_flip.c index c43a26f..7e5e355 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -1129,6 +1129,16 @@ static unsigned event_loop(struct test_output *o, unsigned duration_ms) return end - start; } +static void free_test_output(struct test_output *o) +{ + int i; + + for (i = 0; i < o->count; i++) { + drmModeFreeEncoder(o->kencoder[i]); + drmModeFreeConnector(o->kconnector[i]); + } +} + static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs, int crtc_count, int duration_ms) { @@ -1231,10 +1241,7 @@ out: last_connector = NULL; - for (i = 0; i < o->count; i++) { - drmModeFreeEncoder(o->kencoder[i]); - drmModeFreeConnector(o->kconnector[i]); - } + free_test_output(o); } static int run_test(int duration, int flags) @@ -1261,6 +1268,7 @@ static int run_test(int duration, int flags) if (o.mode_valid) modes++; + free_test_output(&o); } } @@ -1318,6 +1326,7 @@ static int run_pair(int duration, int flags) if (o.mode_valid) modes++; + free_test_output(&o); } } }