From patchwork Mon Feb 7 15:12:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 15340 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 60D36BF415 for ; Mon, 7 Feb 2022 15:12:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B119D61079; Mon, 7 Feb 2022 16:12:20 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="dqjhzCR/"; dkim-atps=neutral Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D90756105F for ; Mon, 7 Feb 2022 16:12:18 +0100 (CET) Received: by mail-wm1-x32e.google.com with SMTP id q198-20020a1ca7cf000000b0037bb52545c6so3957688wme.1 for ; Mon, 07 Feb 2022 07:12:18 -0800 (PST) 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=rj1o9/5KbUdeWSNNP5QvN6GcpJAssLWr3AsS+oiemXM=; b=dqjhzCR/74AipvO4bUAHnFDzXoNkVNzpWYp/DSh8xnlbsfrqxIKwgXQ43I4rlz+fiq eV4yQ7CZC1MgvSOS4oSIYSDykYi1TAy1TVYeJlgsLZ6BgH4AAVw13kY8UcD6FWbCSAw7 X00/fxl0cX+LgAcsouYczm4jAyKy0nSYsp7pWZs1/uWl4+rBR6S5Cofuj6Y3yy+DVI3e BiVoYp7zwnL1VTnS+tbvdIDepOrltm6mbQ5ijOsedeyyirMnqMKfK1HcWpqQ+P7Xi7AG cbSkKMpcofsWH/v34ub6jnsv1qtcaff6SZ2ZA8YKNSuajNKPOFNr3kKwUa9cS5Iq52jw G6xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rj1o9/5KbUdeWSNNP5QvN6GcpJAssLWr3AsS+oiemXM=; b=LxZCEru2Pqwt2/xCIt8qDNZOg7p59wMw5ScWRsmH2WwRYGdsIb5RV6//O7d6oVcbJL pYinIA3vgE5tddgUlwbwNeUqFMXBMLumzjp+CbrjJj810QxGanMCuHZkNrUmFgnCojea xgEptuEa/7iBdjGn8eeAKCxtKgtRnldh+wa00fhnFKmhUQCJH2FH+O3Fn1xOsUs616gW SBd12ll9TQWPrWdJ9SKyOsuIeSRt8GvpzGxWLk9NwJH/JC1FMyr4WLalLhxKlHPqG5q0 wG4J65HFqoJ0N76a+KqlM1u6DludNHxe2Fb0bihOdTpZA2k/9SrcSRCgnvPS07n1BiZc EQJA== X-Gm-Message-State: AOAM532yQP5hM8ETHW1jv2mgVivLhAcXsa+QUTSf+knCHg2KP4Qz2vY5 FrTlmuYPOCuQxmmr5olAnkbPLUoCUpc+ww== X-Google-Smtp-Source: ABdhPJwOhtzsE0/BCqd5ajhUpYFMTvM4wYSIVRllQAirO95ObkL6dQd67LnnLrKN4UD/DhEwuITBJA== X-Received: by 2002:a05:600c:2d45:: with SMTP id a5mr7956244wmg.170.1644246738182; Mon, 07 Feb 2022 07:12:18 -0800 (PST) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:4a96:1adf:459f:8a7e]) by smtp.gmail.com with ESMTPSA id i19sm21463085wmq.45.2022.02.07.07.12.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 07:12:17 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 7 Feb 2022 15:12:12 +0000 Message-Id: <20220207151214.887140-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] pipeline: raspberrypi: Allow Stream::returnBuffer() to handle internal buffers 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" If Stream::returnBuffer() gets passed an internally allocated buffer, it now simply re-queues it back to the device. With this change, the pipeline handler code can be simplified slightly as it does not need multiple code paths for internally allocated and non-internally allocated buffers. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart --- .../pipeline/raspberrypi/raspberrypi.cpp | 53 +++++++++---------- .../pipeline/raspberrypi/rpi_stream.cpp | 7 ++- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 49af56edc1f9..0755de84c70c 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -1877,34 +1877,29 @@ void RPiCameraData::clearIncompleteRequests() void RPiCameraData::handleStreamBuffer(FrameBuffer *buffer, RPi::Stream *stream) { - if (stream->isExternal()) { + /* + * It is possible to be here without a pending request, so check + * that we actually have one to action, otherwise we just return + * buffer back to the stream. + */ + Request *request = requestQueue_.empty() ? nullptr : requestQueue_.front(); + if (!dropFrameCount_ && request && request->findBuffer(stream) == buffer) { /* - * It is possible to be here without a pending request, so check - * that we actually have one to action, otherwise we just return - * buffer back to the stream. + * Check if this is an externally provided buffer, and if + * so, we must stop tracking it in the pipeline handler. */ - Request *request = requestQueue_.empty() ? nullptr : requestQueue_.front(); - if (!dropFrameCount_ && request && request->findBuffer(stream) == buffer) { - /* - * Check if this is an externally provided buffer, and if - * so, we must stop tracking it in the pipeline handler. - */ - handleExternalBuffer(buffer, stream); - /* - * Tag the buffer as completed, returning it to the - * application. - */ - pipe()->completeBuffer(request, buffer); - } else { - /* - * This buffer was not part of the Request, or there is no - * pending request, so we can recycle it. - */ - stream->returnBuffer(buffer); - } + handleExternalBuffer(buffer, stream); + /* + * Tag the buffer as completed, returning it to the + * application. + */ + pipe()->completeBuffer(request, buffer); } else { - /* Simply re-queue the buffer to the requested stream. */ - stream->queueBuffer(buffer); + /* + * This buffer was not part of the Request, or there is no + * pending request, so we can recycle it. + */ + stream->returnBuffer(buffer); } } @@ -2104,7 +2099,7 @@ bool RPiCameraData::findMatchingBuffers(BayerFrame &bayerFrame, FrameBuffer *&em FrameBuffer *b = embeddedQueue_.front(); if (!unicam_[Unicam::Embedded].isExternal() && b->metadata().timestamp < ts) { embeddedQueue_.pop(); - unicam_[Unicam::Embedded].queueBuffer(b); + unicam_[Unicam::Embedded].returnBuffer(b); embeddedRequeueCount++; LOG(RPI, Warning) << "Dropping unmatched input frame in stream " << unicam_[Unicam::Embedded].name(); @@ -2140,7 +2135,7 @@ bool RPiCameraData::findMatchingBuffers(BayerFrame &bayerFrame, FrameBuffer *&em * the front of the queue. This buffer is now orphaned, so requeue * it back to the device. */ - unicam_[Unicam::Image].queueBuffer(bayerQueue_.front().buffer); + unicam_[Unicam::Image].returnBuffer(bayerQueue_.front().buffer); bayerQueue_.pop(); bayerRequeueCount++; LOG(RPI, Warning) << "Dropping unmatched input frame in stream " @@ -2158,7 +2153,7 @@ bool RPiCameraData::findMatchingBuffers(BayerFrame &bayerFrame, FrameBuffer *&em LOG(RPI, Warning) << "Flushing bayer stream!"; while (!bayerQueue_.empty()) { - unicam_[Unicam::Image].queueBuffer(bayerQueue_.front().buffer); + unicam_[Unicam::Image].returnBuffer(bayerQueue_.front().buffer); bayerQueue_.pop(); } flushedBuffers = true; @@ -2175,7 +2170,7 @@ bool RPiCameraData::findMatchingBuffers(BayerFrame &bayerFrame, FrameBuffer *&em LOG(RPI, Warning) << "Flushing embedded data stream!"; while (!embeddedQueue_.empty()) { - unicam_[Unicam::Embedded].queueBuffer(embeddedQueue_.front()); + unicam_[Unicam::Embedded].returnBuffer(embeddedQueue_.front()); embeddedQueue_.pop(); } flushedBuffers = true; diff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp index a421ad09ba50..f446e1ce66c7 100644 --- a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp +++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp @@ -163,8 +163,11 @@ int Stream::queueBuffer(FrameBuffer *buffer) void Stream::returnBuffer(FrameBuffer *buffer) { - /* This can only be called for external streams. */ - ASSERT(external_); + if (!external_) { + /* For internal buffers, simply requeue back to the device. */ + queueToDevice(buffer); + return; + } /* Push this buffer back into the queue to be used again. */ availableBuffers_.push(buffer); From patchwork Mon Feb 7 15:12:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 15341 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 E6B6BBF415 for ; Mon, 7 Feb 2022 15:12:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2E9FE61085; Mon, 7 Feb 2022 16:12:21 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="TLJtr/GO"; dkim-atps=neutral Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id ADD396105F for ; Mon, 7 Feb 2022 16:12:19 +0100 (CET) Received: by mail-wm1-x32c.google.com with SMTP id v129so6564154wme.2 for ; Mon, 07 Feb 2022 07:12:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ldwwezxd1MbR/3Abq8SKMJrIDtvxWlFxRAk2j3Obmr4=; b=TLJtr/GOsncYL+3DHUixneHDa+yRxH+lFEEPKM2KZTsGCrYojXjWd8HRn7ev6cETCs 5EaUBpuAowSUDW+W16NsvDM4Oh8GZSlFC+NL9RKObhJx1cdyCOe9DmGnDWNp4BuFhlNx CO9AjymvPEA0Z3CRy6p75DMjla6GueqOZ/i6jwqmsVjlolI/P4iXaqm4tNqhJUtGT5xY 8uurklDTxYUFoZFXTVAxcskCDNpwMFkE5HrgzHZdYgyKeG/Cunk95JpY9kyvoBVneNJQ OSXCnvpvK4XsX8WkEKK0/ug6ctMU0h0+ApDoO6RV093pVD6sgsv9+NN+BHK0aFSdbgZE 6ocA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ldwwezxd1MbR/3Abq8SKMJrIDtvxWlFxRAk2j3Obmr4=; b=foARRTQX2iKMVZRZ5dZRX93Aw4Fa/b4+4gmz7AG5iNnKfjJw6Dh7tZdp6B1gIhoMAn vVQxpyd2IN72Xoa/FT/DBNIoi5VP9VjAFj2SwN3u7qO1EsxTswtUC0b7jF3gCpSfU62g Gjj6tXl3AzOSRCqIG8DYO9oDKplWGRchglrLVlZk2SeQUxo/5csuP5prb2e6r+uEH3D+ s9os73oQLqhOae25ZxctgedhG3Xc7R6d6UqsivaBLMZ/yKe4xILBgM9IEfcsQmqOwIfT 4oa2ytaELOXaBPrqqXKhNmEibeK4aIhZOTWBvYYcEYu6sCqRSc++CmSVlKX+Wxst6Omo skuQ== X-Gm-Message-State: AOAM530UpUAGAmISMIr2ckh6psZXJHS93pVa3ZDM7XmdhOZWiTEdllLt BsaPyYR1iw9duaF66AaAQgJNhcLGmuWrkQ== X-Google-Smtp-Source: ABdhPJxwzU1Rt+onGgYtFfEc0U2r3zU28SDPnIclztj4VeVnglwXrF4fApsog5sFcVOtpWGdIyOtdw== X-Received: by 2002:a1c:f312:: with SMTP id q18mr11788533wmq.13.1644246739142; Mon, 07 Feb 2022 07:12:19 -0800 (PST) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:4a96:1adf:459f:8a7e]) by smtp.gmail.com with ESMTPSA id i19sm21463085wmq.45.2022.02.07.07.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 07:12:18 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 7 Feb 2022 15:12:13 +0000 Message-Id: <20220207151214.887140-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220207151214.887140-1-naush@raspberrypi.com> References: <20220207151214.887140-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/3] pipeline: raspberrypi: Simplify image/embedded buffer matching logic 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Simplify the image and embedded buffer matching logic by removing the assumption that we require a buffer match between the two streams. Instead, if an image buffer does not match with an embedded data buffer, simply use the ControlList provided by DelayedControls for the sensor parameters. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart --- .../pipeline/raspberrypi/raspberrypi.cpp | 141 ++++-------------- 1 file changed, 31 insertions(+), 110 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 0755de84c70c..af234bd18c5b 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -2081,122 +2081,43 @@ void RPiCameraData::tryRunPipeline() bool RPiCameraData::findMatchingBuffers(BayerFrame &bayerFrame, FrameBuffer *&embeddedBuffer) { - unsigned int embeddedRequeueCount = 0, bayerRequeueCount = 0; - - /* Loop until we find a matching bayer and embedded data buffer. */ - while (!bayerQueue_.empty()) { - /* Start with the front of the bayer queue. */ - FrameBuffer *bayerBuffer = bayerQueue_.front().buffer; - - /* - * Find the embedded data buffer with a matching timestamp to pass to - * the IPA. Any embedded buffers with a timestamp lower than the - * current bayer buffer will be removed and re-queued to the driver. - */ - uint64_t ts = bayerBuffer->metadata().timestamp; - embeddedBuffer = nullptr; - while (!embeddedQueue_.empty()) { - FrameBuffer *b = embeddedQueue_.front(); - if (!unicam_[Unicam::Embedded].isExternal() && b->metadata().timestamp < ts) { - embeddedQueue_.pop(); - unicam_[Unicam::Embedded].returnBuffer(b); - embeddedRequeueCount++; - LOG(RPI, Warning) << "Dropping unmatched input frame in stream " - << unicam_[Unicam::Embedded].name(); - } else if (unicam_[Unicam::Embedded].isExternal() || b->metadata().timestamp == ts) { - /* We pop the item from the queue lower down. */ - embeddedBuffer = b; - break; - } else { - break; /* Only higher timestamps from here. */ - } - } - - if (!embeddedBuffer) { - bool flushedBuffers = false; - - LOG(RPI, Debug) << "Could not find matching embedded buffer"; - - if (!sensorMetadata_) { - /* - * If there is no sensor metadata, simply return the - * first bayer frame in the queue. - */ - LOG(RPI, Debug) << "Returning bayer frame without a match"; - bayerFrame = std::move(bayerQueue_.front()); - bayerQueue_.pop(); - embeddedBuffer = nullptr; - return true; - } - - if (!embeddedQueue_.empty()) { - /* - * Not found a matching embedded buffer for the bayer buffer in - * the front of the queue. This buffer is now orphaned, so requeue - * it back to the device. - */ - unicam_[Unicam::Image].returnBuffer(bayerQueue_.front().buffer); - bayerQueue_.pop(); - bayerRequeueCount++; - LOG(RPI, Warning) << "Dropping unmatched input frame in stream " - << unicam_[Unicam::Image].name(); - } - - /* - * If we have requeued all available embedded data buffers in this loop, - * then we are fully out of sync, so might as well requeue all the pending - * bayer buffers. - */ - if (embeddedRequeueCount == unicam_[Unicam::Embedded].getBuffers().size()) { - /* The embedded queue must be empty at this point! */ - ASSERT(embeddedQueue_.empty()); - - LOG(RPI, Warning) << "Flushing bayer stream!"; - while (!bayerQueue_.empty()) { - unicam_[Unicam::Image].returnBuffer(bayerQueue_.front().buffer); - bayerQueue_.pop(); - } - flushedBuffers = true; - } + if (bayerQueue_.empty()) + return false; - /* - * Similar to the above, if we have requeued all available bayer buffers in - * the loop, then we are fully out of sync, so might as well requeue all the - * pending embedded data buffers. - */ - if (bayerRequeueCount == unicam_[Unicam::Image].getBuffers().size()) { - /* The bayer queue must be empty at this point! */ - ASSERT(bayerQueue_.empty()); - - LOG(RPI, Warning) << "Flushing embedded data stream!"; - while (!embeddedQueue_.empty()) { - unicam_[Unicam::Embedded].returnBuffer(embeddedQueue_.front()); - embeddedQueue_.pop(); - } - flushedBuffers = true; - } + /* Start with the front of the bayer queue. */ + bayerFrame = std::move(bayerQueue_.front()); + bayerQueue_.pop(); - /* - * If the embedded queue has become empty, we cannot do any more. - * Similarly, if we have flushed any one of our queues, we cannot do - * any more. Return from here without a buffer pair. - */ - if (embeddedQueue_.empty() || flushedBuffers) - return false; - } else { - /* - * We have found a matching bayer and embedded data buffer, so - * nothing more to do apart from assigning the bayer frame and - * popping the buffers from the queue. - */ - bayerFrame = std::move(bayerQueue_.front()); - bayerQueue_.pop(); + /* + * Find the embedded data buffer with a matching timestamp to pass to + * the IPA. Any embedded buffers with a timestamp lower than the + * current bayer buffer will be removed and re-queued to the driver. + */ + uint64_t ts = bayerFrame.buffer->metadata().timestamp; + embeddedBuffer = nullptr; + while (!embeddedQueue_.empty()) { + FrameBuffer *b = embeddedQueue_.front(); + if (b->metadata().timestamp < ts) { + embeddedQueue_.pop(); + unicam_[Unicam::Embedded].returnBuffer(b); + LOG(RPI, Debug) << "Dropping unmatched input frame in stream " + << unicam_[Unicam::Embedded].name(); + } else if (b->metadata().timestamp == ts) { + /* Found a match! */ + embeddedBuffer = b; embeddedQueue_.pop(); - return true; + break; + } else { + break; /* Only higher timestamps from here. */ } } - return false; + if (!embeddedBuffer && sensorMetadata_) { + /* Log if there is no matching embedded data buffer found. */ + LOG(RPI, Debug) << "Returning bayer frame without a matching embedded buffer."; + } + + return true; } REGISTER_PIPELINE_HANDLER(PipelineHandlerRPi) From patchwork Mon Feb 7 15:12:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 15342 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 DB374BF415 for ; Mon, 7 Feb 2022 15:12:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E8BDF61086; Mon, 7 Feb 2022 16:12:21 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="VcMqomsA"; dkim-atps=neutral Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 578B16105F for ; Mon, 7 Feb 2022 16:12:20 +0100 (CET) Received: by mail-wm1-x329.google.com with SMTP id k127-20020a1ca185000000b0037bc4be8713so2324943wme.3 for ; Mon, 07 Feb 2022 07:12:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b+ZMf4eVFVMwWoM8wQemRo2DNOLvFAHjzpnIVlUsGZA=; b=VcMqomsArDG5ggX5CD68jYsKFJA43PJXI+K4x+ZYQDOd8GDlD4i75MgBjxpvjhWn0B FxzQwefq0UodfG3rSSy462GbfVVp8H5H5YS1n6/QcmeT9yIqXG27cAajkF3KUQ8JNsH3 Bm/VntCNg5r6oym+XNMsnii0wQfsMZeYEshuc8yf2pNhyO9lNxkQzcYtkpWWP2AtI5oW iZfDAaZdH6oMEg1+GcHZAZnwO7MSzxcb8zWcO1iNYnIgHcqSz18U64e7t0g5Tlxlt9H+ dFNZUMg9LxU5nD8DLsQf9U73T3x6IKRWtTWSqsYtYZQZIWivtGBrpD0CytKTJDzrnBuP RYoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b+ZMf4eVFVMwWoM8wQemRo2DNOLvFAHjzpnIVlUsGZA=; b=Mh3x7wczs5stvLGBF0k2yIP5ofKNP3TXbnHL3RrQdGkevu26Aqy0OO9UCpS+tkjrWj VBNbssp2fK49U/ObCRudut/dtSY5kxqm/K9Fso+ph5FM36C8TC2P9cmatMbsL1zQW6NU rNaKgCj6f+WMTJbz30kfBMRs+a0Bs1KDriBOycU1Vcy0yr2jsMJQmyZVkvg7k0cVy0ZB T3/AHRskTIb6l3VYR5grE4yfnaizLGogF9WnEw0ug5UpPNJuxts/wD3cVVAN6GVhnDyn pIzQW2CrlNztz4mLC6xTAcDC7BNfvBlIo0LBhLhk99L25t7L+uvDJEi+zl7lZCLXs2rY d3cg== X-Gm-Message-State: AOAM533ljT+eyb9qgWaIouDCjTY9k64a2V0sgou5pXjO2aNNpl6Bwg57 a6tubjE93FXLiFUidyS3khBFNudx7memlQ== X-Google-Smtp-Source: ABdhPJzT972KDBiuVx9lzCi371BC8EZUTIWnwsgHA9gpHF3EGOqWWIF07P/7b710luBs2tasazEh+w== X-Received: by 2002:a7b:cb9a:: with SMTP id m26mr24052wmi.18.1644246739861; Mon, 07 Feb 2022 07:12:19 -0800 (PST) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:4a96:1adf:459f:8a7e]) by smtp.gmail.com with ESMTPSA id i19sm21463085wmq.45.2022.02.07.07.12.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 07:12:19 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 7 Feb 2022 15:12:14 +0000 Message-Id: <20220207151214.887140-3-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220207151214.887140-1-naush@raspberrypi.com> References: <20220207151214.887140-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/3] ipa: raspberrypi: Reduce the controller rate to 30fps 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" With the controller algorithms running at 60fps, there are some dropped frames when running at very high famerates. Reducing this to 30fps eliminates all these drops without any noticeable changes to the image quality. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart Reviewed-by: David Plowman --- src/ipa/raspberrypi/raspberrypi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index a72d516f84ee..fd8fecb07f81 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -70,7 +70,7 @@ constexpr Duration defaultMaxFrameDuration = 250.0s; * we rate-limit the controller Prepare() and Process() calls to lower than or * equal to this rate. */ -constexpr Duration controllerMinFrameDuration = 1.0s / 60.0; +constexpr Duration controllerMinFrameDuration = 1.0s / 30.0; LOG_DEFINE_CATEGORY(IPARPI)