From patchwork Thu May 28 14:56:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 3873 Return-Path: Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F13F7603D3 for ; Thu, 28 May 2020 16:56:58 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Cjg72J38"; dkim-atps=neutral Received: by mail-wm1-x344.google.com with SMTP id k26so3504583wmi.4 for ; Thu, 28 May 2020 07:56:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ID/1DFSPVuzcaftDoa7/nRMLlBxQx2xZ8JyhKbsf0d8=; b=Cjg72J38xO7Tn2Ef5ukrQbUtQoQNZNjvdUE78fwWTGP3hSU+g+0tBSzGB+JOS59mPM ZFuQXiysRk7WGrKkBBQFD32FItSfvndqCapyxXroO2Ur+tuSIp154qhAUwH6xDHUedUS GDXBzLUjPlq7AdukhVmVPli+PDY9OBvFsBRRuVLlf2fCKH5wOrx4HpA99aJh1EXax1F+ VMjtszU4crXr49hD2amPmvZzvEtax80i1ZG68pjoYN/YnBQ11vTGwuxTjdqqF8NsQi/L GXPE0i/UP15LT9e4ShFd2X9HTncPFxz+2tyQN28DxOGly8qKroEimu6KIGTdrXMkLbZh 34aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ID/1DFSPVuzcaftDoa7/nRMLlBxQx2xZ8JyhKbsf0d8=; b=USyjno7Gi6FJEb4eWEm8yrmMwxEaew4u2XBjsQpMwKE8Urr1dcw5E1MZ+cjuof4rx9 zG6pYy7Vk1+w3I27qmqVVRFQ8lbMVnZK58Fv6HaR9WShLXtTeIrGZXwkD7nMsxTeIF74 Zjx2F4RfNALRxtXd73VvyrNizM8sZpCWiIhktXxELqN6XNZpLjafi3EGBWGwtMilPQ28 uj535EnzsiXSmQBKix6uneZWeitg9I7lQv1BHB0r0EOs8lQGwWSIxD5CrcTJgM8jYloI +49NDe8mPz2evzyLz+ONZbsCX2mgAPYb3Nu3I0Yl99+vVC3HMGG0bqOuvxmzx4XosNca nlfw== X-Gm-Message-State: AOAM5337M3CxzCDFU4G2CvwaaejxkAUW8IafeV7OgAqMt64Fwo2WFVqY EpvxU5tvvIBOPL5eKAZwQZZ9CRFjJP59rA== X-Google-Smtp-Source: ABdhPJzQnIFcz5rW04hMGTScPeOwa6LHlufIyaniGxk5XKzWaC4Z7Z7g1c03Cg05PyqqV7Qt3WGuAA== X-Received: by 2002:a1c:7e43:: with SMTP id z64mr3660868wmc.72.1590677818248; Thu, 28 May 2020 07:56:58 -0700 (PDT) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id n1sm6148786wrp.10.2020.05.28.07.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 07:56:56 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Thu, 28 May 2020 15:56:10 +0100 Message-Id: <20200528145610.96585-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] pipeline: raspberrypi: Fix for staggered write on reset 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-List-Received-Date: Thu, 28 May 2020 14:56:59 -0000 The reset function in staggered write was using the wrong index when looking for the last updated camera parameters. This would cause possibly stale exposure values to be written to the camera on a mode switch for captures. Signed-off-by: Naushir Patuck Signed-off-by: David Plowman --- src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp index 391e13f5..b26fa63d 100644 --- a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp +++ b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp @@ -46,7 +46,7 @@ void StaggeredCtrl::reset() { std::lock_guard lock(lock_); - int lastSetCount = std::max(0, setCount_ - 1); + int lastSetCount = std::max(0, setCount_); std::unordered_map lastVal; /* Reset the counters. */