From patchwork Thu Jun 18 11:12:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 4075 Return-Path: Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7D4F3603C1 for ; Thu, 18 Jun 2020 13:12:53 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Xzyw7u1l"; dkim-atps=neutral Received: by mail-wr1-x429.google.com with SMTP id p5so5590965wrw.9 for ; Thu, 18 Jun 2020 04:12:53 -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=9mdhKA27ya4/BoHLdpagxaW25BUx492sYOkPUZ0yyPg=; b=Xzyw7u1lEA2WWQd6r0aDYUkoYkn+SV+mL1LLGXgXGRustg1+uhKH/wwLqCEGlM6hb5 1j7kQXp7E2lREiS8QqEqFeVBc/qzY+lRJa8I7NFF/IRnCJd1Tv0EyMOYhzIsk3wsnAdD TAjv6FEEW11QmhVtrFZYBQTgjdnl87c4FhLI9qKmqpRWqJVg43jzMIbO4tB9GLokCO/y EmwWsXpILN51R3/rW7BnJOQCEPZMhUnP18G2uVi68pXof82nqV+KUcGDyJkaI+aYd/x6 VUoQ8vpchUWxqUdjfDqguqfToOG5rNZhD2CzqBFXM6EgpTgZBQUcdDadv4yIi+z8qSOo Ug1g== 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=9mdhKA27ya4/BoHLdpagxaW25BUx492sYOkPUZ0yyPg=; b=MmDucHqXH7hhTkIsIe8FOvv0R9T2yZa6gmi8662ZpZxPJDPmbWsWsNHwu1nbsNg8jC RQRh5byBP7LFiPNSRkj9jvz4Es6pj+g7o8MXDpds4AJjYJdNyhU1IM/QJShz9P67o7K5 c0aymL1HE38mZNLLE8XeXHXlEqMoFcfAQxR9zGwg8D5nSRsKlh9H42/GGXHK00dEHu+n tvNXsZKzXOmaIcdsJ/aSj8nYUUbCVmHEaOZxAbTTMXhu8K0FxKzcY+Z/dBqtAPrT1BsD Z+x/Wb2uHpZbgI+Hmm+eiVhNY5fHc1PHiKebCuo/PRTnOKtV+3C8jVNmEMdRYxZGTgM3 IiBQ== X-Gm-Message-State: AOAM5300zsI06ZP/O2S/WIEZLF4o3H5s4cCLv3SSeWWrEuDxWvqWQhqk 1NWOxJ9A6LWUgqi5QYLg0mbGx1OLI+k= X-Google-Smtp-Source: ABdhPJyGL6dRam0WEWesnGpWSTY1pOxC9Tu5NV66pYKnfzvu3pVd4jhMvhvgNKUarTuUWXvzK2Y3YA== X-Received: by 2002:a5d:6987:: with SMTP id g7mr1411112wru.79.1592478772335; Thu, 18 Jun 2020 04:12:52 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id e10sm3103857wrn.11.2020.06.18.04.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2020 04:12:50 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 18 Jun 2020 12:12:34 +0100 Message-Id: <20200618111236.26897-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/2] Raspberry pi IPAs: update sensor exposure/gain when camera mode changes 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, 18 Jun 2020 11:12:53 -0000 Hi Here's version 2 of this patch hopefully taking the review comments into account. When a new sensor mode is selected, and the pipeline re-configured, the exposure/gain must be recalculated because: 1. an application might select a new exposure profile from the camera tuning which divides up the exposure/gain differently, and 2. the line timings may change, and the sensor driver stores exposure as a number of lines, meaning the time could change "under our feet" if we didn't recalculate the lines correctly. Best regards David David Plowman (2): libcamera: raspberrypi: allow SwitchMode method to return camera settings libcamera: raspberrypi: recalculate camera exposure/gain when camera mode changes src/ipa/raspberrypi/controller/algorithm.cpp | 3 +- src/ipa/raspberrypi/controller/algorithm.hpp | 2 +- src/ipa/raspberrypi/controller/controller.cpp | 4 +-- src/ipa/raspberrypi/controller/controller.hpp | 2 +- src/ipa/raspberrypi/controller/rpi/agc.cpp | 12 ++++++++ src/ipa/raspberrypi/controller/rpi/agc.hpp | 1 + src/ipa/raspberrypi/controller/rpi/alsc.cpp | 4 ++- src/ipa/raspberrypi/controller/rpi/alsc.hpp | 2 +- src/ipa/raspberrypi/controller/rpi/noise.cpp | 4 ++- src/ipa/raspberrypi/controller/rpi/noise.hpp | 2 +- .../raspberrypi/controller/rpi/sharpen.cpp | 4 ++- .../raspberrypi/controller/rpi/sharpen.hpp | 2 +- src/ipa/raspberrypi/raspberrypi.cpp | 28 ++++++++++--------- 13 files changed, 46 insertions(+), 24 deletions(-)