From patchwork Tue Jul 5 18:43:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 16552 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4FF53BD1F1 for ; Tue, 5 Jul 2022 18:44:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8B45E63310; Tue, 5 Jul 2022 20:44:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1657046676; bh=5swoiqBMTQia3hxBC6qWJ1ZJ9OqOyUePFLCvLinNH3E=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=QY/RRH9G0IXgg7ulsLE0LVbc6liy2L3GXSm8Yc6ajrDBlsCYj4bOoDiydkHItIP71 eneyySVTGQhpGtY/wQ+pTcZ7TPOeti1Ufi0twJFA+5KGK1IyAnsi/o+R2sN3bfXJJE 9vcXOEX1e1W4decCGiYOwnTKhHswX52LLSwz/xp6nRsU3NpgFpNRJQz3vPCM0bjB9L ryJnz9R6XbbWiXAdf0zz6amXBBh++55jCeDGsiZxLIkyVqld6pNaIqjXFa3uKhTkGn OiVbcc3rBwp92Dumo+PGF62XXyNUFkhvO2/C1DeQUbB1zrpLSjc654mEKLDDTVW9vN WnW8U3Vf3SkMA== Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 88FC561FB0 for ; Tue, 5 Jul 2022 20:44:34 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id C7FB520007; Tue, 5 Jul 2022 18:44:33 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Tue, 5 Jul 2022 20:43:50 +0200 Message-Id: <20220705184350.31369-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] test: delayed_controls: Remove sequenceOffset X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Commit 6f539a6d2fa9 ("delayed_controls: Remove reduandant firstSequence_") removed support for frame number start offset from the DelayedControls class, as it is now guaranteed that the first sequence number as it comes from the V4L2VideoDevice will always be 0. However the delayed_controls.cpp unit still has two tests that passes a non-zero first sequence number to the DelayedControl class, causing the test to spin forever and consequentially fail. Remove the two tests from the unit to fix this. The first removed test was testing the class against frame start sequence numbers greater than zero and can safely be removed. The second test was instead validating the class against sequence number overflow, which is now not possible to test anymore as the DelayedControls class now assumes 0 as first frame sequence number. Fixes: 6f539a6d2fa9 ("delayed_controls: Remove reduandant firstSequence_") Signed-off-by: Jacopo Mondi Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- test/delayed_controls.cpp | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/test/delayed_controls.cpp b/test/delayed_controls.cpp index c6f195b7bc7f..a8ce9828d73d 100644 --- a/test/delayed_controls.cpp +++ b/test/delayed_controls.cpp @@ -155,7 +155,7 @@ protected: return TestPass; } - int dualControlsWithDelay(uint32_t startOffset) + int dualControlsWithDelay() { static const unsigned int maxDelay = 2; @@ -175,25 +175,24 @@ protected: delayed->reset(); /* Trigger the first frame start event */ - delayed->applyControls(startOffset); + delayed->applyControls(0); /* Test dual control with delay. */ for (unsigned int i = 1; i < 100; i++) { - uint32_t frame = startOffset + i; int32_t value = 10 + i; ctrls.set(V4L2_CID_BRIGHTNESS, value); ctrls.set(V4L2_CID_CONTRAST, value + 1); delayed->push(ctrls); - delayed->applyControls(frame); + delayed->applyControls(i); - ControlList result = delayed->get(frame); + ControlList result = delayed->get(i); int32_t brightness = result.get(V4L2_CID_BRIGHTNESS).get(); int32_t contrast = result.get(V4L2_CID_CONTRAST).get(); if (brightness != expected || contrast != expected + 1) { cerr << "Failed dual controls" - << " frame " << frame + << " frame " << i << " brightness " << brightness << " contrast " << contrast << " expected " << expected @@ -283,17 +282,7 @@ protected: return ret; /* Test dual controls with different delays. */ - ret = dualControlsWithDelay(0); - if (ret) - return ret; - - /* Test dual controls with non-zero sequence start. */ - ret = dualControlsWithDelay(10000); - if (ret) - return ret; - - /* Test dual controls with sequence number wraparound. */ - ret = dualControlsWithDelay(UINT32_MAX - 50); + ret = dualControlsWithDelay(); if (ret) return ret;