From patchwork Tue Oct 4 22:29:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17526 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 AC923C327C for ; Tue, 4 Oct 2022 22:29:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5D2CD60AD1; Wed, 5 Oct 2022 00:29:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664922553; bh=wnq0fDCsKrF3lIbogEVCUb6rc83T/y14IHAljEfb7IY=; 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=rOvEPtm/nBiPmT/UfbbxOOY8vyiViFUFjyYU5DSJsC74GScveauwKWzgfE3H3eG9E pjrqxyQWBOJoZbb+lX0kCwkJrUPTiEY2USoRyIDlrX8pnV8qFZrh7ueuOYHTRVYZJv x0pFWHdfdqQg5DdZ9JDpUMET9vhvv3vK/EWXkVflvokTJI2ODRH0Ja2v9FbTqjZMgh roJRYheOOCYIsUSUc8RcWCFEhAb70My6qmNbpYYXKBchhUfJVVemDs/LMw7hAuvc+L eBbZuYSfcBIvcphFEhXo3IHucXsLRz5YKm0R7r3R4D/3aDgQq2ryNrYZNetbfbkVKU J0a3tYkJX5fAQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4C40660AC6 for ; Wed, 5 Oct 2022 00:29:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="h4Fw5GDN"; 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 1622BFA0; Wed, 5 Oct 2022 00:29:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664922551; bh=wnq0fDCsKrF3lIbogEVCUb6rc83T/y14IHAljEfb7IY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h4Fw5GDNIg5dvEMa7LT3LHlvtaQ3iC2wGJ0IMMpxq3KHwBYOgc+2rLVvkTUrs4bir KB4ZdfSp7gX28S5Igf3KMkS5d1yms70ikcqUj0E+1PTa+FniVTSn3remgrIvD1XlC/ vkNH3FectvAi+2VsnPv1GX+f6bTktcZ9EAkdBaC4= To: libcamera-devel@lists.libcamera.org Date: Wed, 5 Oct 2022 01:29:02 +0300 Message-Id: <20221004222903.6393-4-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 3/4] pipeline: rkisp1: 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/rkisp1/rkisp1.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 25fbf9f1a0a9..455ee2a0a711 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -32,6 +33,7 @@ #include "libcamera/internal/camera_sensor.h" #include "libcamera/internal/delayed_controls.h" #include "libcamera/internal/device_enumerator.h" +#include "libcamera/internal/framebuffer.h" #include "libcamera/internal/ipa_manager.h" #include "libcamera/internal/media_device.h" #include "libcamera/internal/pipeline_handler.h" @@ -362,6 +364,8 @@ void RkISP1CameraData::paramFilled(unsigned int frame) if (!info) return; + info->paramBuffer->_d()->metadata().planes()[0].bytesused = + sizeof(struct rkisp1_params_cfg); pipe->param_->queueBuffer(info->paramBuffer); pipe->stat_->queueBuffer(info->statBuffer);