From patchwork Tue May 13 17:43:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 23364 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 53B24C3200 for ; Tue, 13 May 2025 17:46:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7626B68B55; Tue, 13 May 2025 19:46:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oQnEV0h6"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0722768B40 for ; Tue, 13 May 2025 19:46:22 +0200 (CEST) Received: from charm.hippo-penny.ts.net (unknown [IPv6:2001:861:3a80:3300:485e:25b2:e7f9:296e]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 11F0D1D5; Tue, 13 May 2025 19:46:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1747158366; bh=x04P91Py/h78lpIUXrjj/vsawVOSVt8WvYt1F1gQG+A=; h=From:To:Cc:Subject:Date:From; b=oQnEV0h6uUBDoQThP15rzIr7DPq2AFMZBfwQ6os/Ea3NSNqJTP+u75pQfTlu+PR4X LWgal+mE6KrogZAsBinpPHBxO2qhaSezl4NFdfS9jUMlFm3jNieTnj1h7UPzJUr4tB dEkDoerzLPdKkji/kq89tMBEQxgFKtvM2iWFj950= From: Kieran Bingham To: libcamera devel Cc: Kieran Bingham Subject: [PATCH] [RFC] libcamera: pipeline: Add h/v blanking delays Date: Tue, 13 May 2025 19:43:12 +0200 Message-ID: <20250513174312.106676-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 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" The HBLANK and VBLANK control delays are not being accounted for in all of the libipa platforms. Update their delayed controls instantiation accordingly. In particular, update the RKISP1 VBLANK control delay to be marked as a priority control as well as setting the correct delay to align with the existing Raspberry Pi implementation. Signed-off-by: Kieran Bingham --- Marking this as RFC because I haven't tested this or explored it yet - but as I was reviewing other parts of the code base - I noted that these are inconsistent across pipeline handlers - so lets figure out why and make sure all the pipeline handlers operate in the same way where possible. src/libcamera/pipeline/ipu3/ipu3.cpp | 2 ++ src/libcamera/pipeline/mali-c55/mali-c55.cpp | 2 ++ src/libcamera/pipeline/rkisp1/rkisp1.cpp | 3 ++- src/libcamera/pipeline/simple/simple.cpp | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index e31e3879dcc9..4cec22b01940 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1082,6 +1082,8 @@ int PipelineHandlerIPU3::registerCameras() std::unordered_map params = { { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } }, { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } }, + { V4L2_CID_HBLANK, { delays.hblankDelay, false } }, + { V4L2_CID_VBLANK, { delays.vblankDelay, true } }, }; data->delayedCtrls_ = diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index a05e11fccf8d..7d052263b34d 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -1607,6 +1607,8 @@ bool PipelineHandlerMaliC55::registerSensorCamera(MediaLink *ispLink) std::unordered_map params = { { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } }, { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } }, + { V4L2_CID_HBLANK, { delays.hblankDelay, false } }, + { V4L2_CID_VBLANK, { delays.vblankDelay, true } }, }; data->delayedCtrls_ = diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 52633fe3cb85..6c5b81b9a2ba 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -1325,7 +1325,8 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor) std::unordered_map params = { { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } }, { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } }, - { V4L2_CID_VBLANK, { 1, false } }, + { V4L2_CID_HBLANK, { delays.hblankDelay, false } }, + { V4L2_CID_VBLANK, { delays.vblankDelay, true } }, }; data->delayedCtrls_ = diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index efb07051b175..fc88efc7a716 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -546,6 +546,8 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe, std::unordered_map params = { { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } }, { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } }, + { V4L2_CID_HBLANK, { delays.hblankDelay, false } }, + { V4L2_CID_VBLANK, { delays.vblankDelay, true } }, }; delayedCtrls_ = std::make_unique(sensor_->device(), params);