From patchwork Wed Nov 18 16:46:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: GuyliandeJong X-Patchwork-Id: 29024 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 C8411C3304 for ; Wed, 18 Nov 2026 16:46:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 782F26A900; Wed, 18 Nov 2026 17:46:56 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=proton.me header.i=@proton.me header.b="DDIGgsqc"; dkim-atps=neutral Received: from mail-43102.protonmail.ch (mail-43102.protonmail.ch [185.70.43.102]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7EA556A8FA for ; Wed, 18 Nov 2026 17:46:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail2; t=1795020413; x=1795279613; bh=LWlYmnBoboC4FiBpGPYgmPX2THORFoozu0bMkcfpG2c=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=DDIGgsqc79LC2X4hMHty3+5xTcy/zIgig4wgCLFxs/yN9q7S/bX1IYvW/l6JVuv1V +7MpuHgCa7+SK5xBrYWmv5HhqnwqqcV+YzRfTxJLUVjLZrpzV71ZzSFprHCtNCjlYc pVUziDNVAmWdLOVGKVbmHXmn7WlqdvyeBWMuZvoNipBSzRZtTqWURpTit0TzKCLow9 U9JStMcQdE6DGiryRnSPQvKESTLH138xd28o3dgXsd10RA13+6JW8Pxqx/50Qqbhbs 2VLErnWSdE+L621Ci9aeUjMz+nOTRCIld6WlNoT5N0IbUin50MSq0FmTkyt3ATP0cK COSkIJKASqZdg== Date: Wed, 18 Nov 2026 16:46:50 +0000 To: libcamera-devel@lists.libcamera.org From: GuyliandeJong Cc: Daniel Scally , Barnabas Pocze , Afonso Figuinha Subject: [PATCH 3/6] libcamera: pipeline: ipu3: Report the first ImgU frame as an error Message-ID: <20261118164621.15513-4-guyliandejong@proton.me> In-Reply-To: <20261118164621.15513-1-guyliandejong@proton.me> References: <20261118164621.15513-1-guyliandejong@proton.me> Feedback-ID: 112452169:user:proton X-Pm-Message-ID: 3c95d0038028f86e50a16c4b4d7e845147c2c481 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" After the output size of the ImgU changes, the first frame it produces is processed with parameters left over from the previous configuration and contains horizontal bars of random colours. Applications show this frame, for instance as a flash of pink and blue bars when a video call preview opens. On an OV9734, alternating between 1280x704, 640x360 and 1024x576 with v4l2-ctl through the V4L2 compatibility layer, the first frame after each size change has a strong colour cast (an average V offset of +24 to -41 against 0 to 3 for the following frames), and the following frames are correct. Report the ImgU output buffers of the first request as FrameError, so that applications drop them. The V4L2 compatibility layer passes this on as V4L2_BUF_FLAG_ERROR. Signed-off-by: GuyliandeJong --- src/libcamera/pipeline/ipu3/ipu3.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 46af776e..c951b49c 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1270,6 +1270,16 @@ void IPU3CameraData::imguOutputBufferReady(FrameBuffer *buffer) Request *request = info->request; + /* + * The ImgU processes the first frame after starting with parameters + * left over from the previous configuration. After a change of the + * output size, this produces horizontal bars of random colours. Report + * the first frame as an error so that applications drop it. + */ + if (request->sequence() == 0 && + buffer->metadata().status == FrameMetadata::FrameSuccess) + buffer->_d()->metadata().status = FrameMetadata::FrameError; + pipe()->completeBuffer(request, buffer); request->_d()->metadata().set(controls::draft::PipelineDepth, 3);