From patchwork Sun Oct 2 00:36:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17486 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 0922AC327E for ; Sun, 2 Oct 2022 00:36:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 97AC662CBF; 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=wuvYJnxWqiRujtRNfHqpvwzxadfbuedvqw+B/SOF460=; 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=j7vmuYGHFHBg0MdvxLE4EieYhSYzpNBK32IyvA+x3zzbDPjNo97fFf3k4z2+zICeG DaOhS7ZVH5eDI1BnPMVE+CczEY9NdjX0tABr+6u9Z9HGDJDi3si1ql4eUfti/6SszC Xe2M46sINVaoHlQ7aT/xW7hYhCwW2dIuoPrkoRdDwQg97TgRzXCd5ztgB1apPe7lOB grlV05o9K8rEIzY/qgnhEASIyE8ldB32S04dQGWaAewEenZ3ze4enU7Vy598NYjDYR ztoHh6FPPOngOG3wUF6Qg00Ng4O+9W0AgiPc4GSX0P+NbAPwaGsN7MqFJsMZ4t2NMx xIiGE/ZayWhVw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 596A062CB7 for ; Sun, 2 Oct 2022 02:36:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SZmFRFKy"; 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 DB2E8517 for ; Sun, 2 Oct 2022 02:36:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664670979; bh=wuvYJnxWqiRujtRNfHqpvwzxadfbuedvqw+B/SOF460=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SZmFRFKyKz74I9D6oWVcIMCdWvaA4WiTLB8sj8/BosHe+s7zFHa39gU3v4Se9KsyX s+90HSlI4Z1f6iP+nJx2VyTBpNPgJEjPsKkEAD/9RsUmAV+FWh6/lz+MtA15adOhf3 2XumSvtLVUP/oM3oORA6JbA5ZKnzeLFpv32FljeU= To: libcamera-devel@lists.libcamera.org Date: Sun, 2 Oct 2022 03:36:12 +0300 Message-Id: <20221002003612.13603-5-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 4/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 --- 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);