From patchwork Sun Oct 2 00:36:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17485 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 5A208BD16B for ; Sun, 2 Oct 2022 00:36:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0838562CC0; Sun, 2 Oct 2022 02:36:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664670981; bh=lNmBj/hq6wT2f5i5/WjoHWz3vFp6YEGUENmrDVivnRQ=; 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=pMHMbqHsj5kzoGG1OUImruHlsk0rfkROKyuwwDHLyjeYxvx1mL2Ey60nAy6RkvjlA 7cxceiKMohKCUv277pfxIPt4W114dz4kx573kmQanZE/CFNYkmSJ1jGQE1VIo99CXk Rq/Au7aAwSF4WO0AMk5+cq2P8Lse8KMmUWNkNKL1xHZ+dNIDLhek/k4AwoDB3f2OAu 8//YMm3Q2D7oKl93KeN6x+dGyjceTFkKxf2Ru52LaLu9QKK2mjeOO9dkLaGw4Dz2ad aM0zqWHH5kEJrj0n3XHerLxFvrmABYvFJ0mpVNcSfS/A+2x7mu3nH6WKLMv7aw12Fw QFtLJsVoGbL1A== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 27B8B62CB2 for ; Sun, 2 Oct 2022 02:36:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SNMTBD5j"; 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 9E4C2517 for ; Sun, 2 Oct 2022 02:36:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664670977; bh=lNmBj/hq6wT2f5i5/WjoHWz3vFp6YEGUENmrDVivnRQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SNMTBD5jdTvXrDNcUtS9ljCyeZIOmGhS0P2QdiZDP1XK+jTr8YWuGm2Uof8MI44J5 /LYRt2dzXNvj8g8dV+WDEk0hzRK8bIsQWK0RwUD7IM1sc/VF0rBz5121M0ZW8t4aMl r8v0l95awpYkICv5G+qc8800273OW6JwXT3DBLuA= To: libcamera-devel@lists.libcamera.org Date: Sun, 2 Oct 2022 03:36:11 +0300 Message-Id: <20221002003612.13603-4-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221002003612.13603-1-laurent.pinchart@ideasonboard.com> References: <20221002003612.13603-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/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 --- 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);