From patchwork Tue Oct 4 22:29:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17525 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 3BB5EBD16B for ; Tue, 4 Oct 2022 22:29:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E67F160ACA; Wed, 5 Oct 2022 00:29:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664922551; bh=l48UoKpgn2xtn7SvJNa0pHvCj4usc5TCidd2hWVXZ8k=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=QUmUw5nzscAq6ajnbov2NBj7UPL5U4oPaZbx1LG9MFwQHao+1SKFhI8WVe762ASyt l/FSZWsedv3Pk8h0FysYfRHdSlGsB1xSrRZz9A7FwF45zqOgoSaWZFJ56IxnJN/MI/ fOYgczGDbU5GU7BLmEmVSKHVARqPQNzseDF0nMYVOTm29SAYe88HAQfnQrfrpRiVp8 pQxlVWreTVhwqxt1nsBN9PfLxuGinmOKajZH5ecPbw9tpCPyMwWo5ezaVom39XMvyi z9rNFiQTwXuVnoGCL/JzkK7LLml+YaMpm7l3BbDcGOwZmXYrOg0iUe5EMdHvme3W+5 rAJeQ6ZoGPkNQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A8A760AC9 for ; Wed, 5 Oct 2022 00:29:10 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="D/XEdoVr"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A8B11997; Wed, 5 Oct 2022 00:29:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664922549; bh=l48UoKpgn2xtn7SvJNa0pHvCj4usc5TCidd2hWVXZ8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D/XEdoVrjit3y4JsMyYMw1qOCu5GrLmH+bXmOdxfSQ2ngMUN/K6D76uztMxeKUKRd GJBCqN+3iqS3vz6f2invnVYWsN3OPNwRxeJWDEhdCJks7kwP9+4ou5ZmNEZzZ/DVSX nTbUXcKEn5gYX5N95Uky61jKJ8mbZ/y3QhxzFD+4= To: libcamera-devel@lists.libcamera.org Date: Wed, 5 Oct 2022 01:29:01 +0300 Message-Id: <20221004222903.6393-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221004222903.6393-1-laurent.pinchart@ideasonboard.com> References: <20221004222903.6393-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/4] pipeline: ipu3: Set bytesused before queuing parameters buffer 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-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The bytesused value for the parameters buffer is initialized to 0 and never set. The V4L2 API specification indicates that, for an output video device, the driver will set the bytesused value to the size of the plane in that case. The videobuf2 framework does so, but considers this as deprecated and prints a warning: [ 54.375534] use of bytesused == 0 is deprecated and will be removed in the future, [ 54.388026] use the actual size instead. Fix it by setting bytesused to the correct value before queuing the parameters buffer. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Umang Jain --- src/libcamera/pipeline/ipu3/ipu3.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 93219a6c1134..3b892d9671c5 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -11,6 +11,8 @@ #include #include +#include + #include #include @@ -1298,6 +1300,8 @@ void IPU3CameraData::paramsBufferReady(unsigned int id) imgu_->viewfinder_->queueBuffer(outbuffer); } + info->paramBuffer->_d()->metadata().planes()[0].bytesused = + sizeof(struct ipu3_uapi_params); imgu_->param_->queueBuffer(info->paramBuffer); imgu_->stat_->queueBuffer(info->statBuffer); imgu_->input_->queueBuffer(info->rawBuffer);