From patchwork Fri May 29 07:16:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 3876 Return-Path: Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BEADB603CE for ; Fri, 29 May 2020 09:16:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Ghfv5oMv"; dkim-atps=neutral Received: by mail-wm1-x343.google.com with SMTP id h4so2002063wmb.4 for ; Fri, 29 May 2020 00:16:59 -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=soaHbx0SRnNGamhNaO3oA35SUJCWpzFvTUZjcj5xtmY=; b=Ghfv5oMvROnQGYKXgq6ZQ/9i27EO05AQS63wxVt691HaGA2UZRxIFnzI6O5oZDdZ9K zLuZEu769Qg0XrNrhHOZ8MIZOkFinVEt46ezhGSaU75K3ineKjkJS4q2n40ERKgRKl09 LNkoV99WK/+8hUTc1qr08FNsnIrPK4UjStge6iyOqJze2dJr5Ua/vE9MbxA29lRmSPFf B6Z1/Uf13tkox6Jx6J48FhDwyJdtRnBz3yHKvufl4x+ALyEnr0NqyEPHSmSFXqbg/mrR OqTuhmPIxQaSLue5W4Bwp4mnQ5ptaKXyefBNXbA3h9f6WU6DQg2MsW24ahgtNSF5TLa0 uGfg== 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=soaHbx0SRnNGamhNaO3oA35SUJCWpzFvTUZjcj5xtmY=; b=e3vwIk40AFrU7VAJSUjbUpussOOTZoOWwl3yWRV4yzkHYKvDlmxgHUP+BUAbwDac1s p2Zzv/2LYvP8kd3iOZ5c/Kzo2S5Q3Bn7aLW2xOB66tzD9wwgPYy7hWYVS+5gDpiNZFyF Xv0TE+Kqg6SqUjKFJkGPdCEJwRxp+ldQLXAoWF7nceyzMU1y2BoukG2AiofR2vSjfs4z zi+ifzlG5VSGhfkGexPzdz8pRGMvoY1ILwWMSRlTISZzg5s2vWtkTX4XVMdy62ODXQPX 9YBbu0RXkUVo2rSHXQpXpevWqYkRnWJQcDyoBS8O+WH7DxKBKqhWfrhZ3z8Qi3LmrB5w UOxg== X-Gm-Message-State: AOAM531GaczZicOW3Ly9XXYFPT96iyYWmnhcPTF6VjYqLlZwORepOJVf 4fV211RStBTEAZ/5vwMDdjR4tgWtB1pF1g== X-Google-Smtp-Source: ABdhPJwZ9QhXoFJ4xNkLN6qQYEsFt86/jBc66/uANWpHAlBSNVTVyPIwzPFt7GeHa4CqIJxfPRk6YQ== X-Received: by 2002:a1c:810a:: with SMTP id c10mr7080798wmd.107.1590736618094; Fri, 29 May 2020 00:16:58 -0700 (PDT) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id r4sm8668849wro.32.2020.05.29.00.16.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 00:16:57 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Fri, 29 May 2020 08:16:46 +0100 Message-Id: <20200529071646.123149-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] 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: Fri, 29 May 2020 07:17:00 -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 Reviewed-by: Kieran Bingham --- 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..5ed63a8e 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 = setCount_; std::unordered_map lastVal; /* Reset the counters. */