From patchwork Tue Oct 4 22:29:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17527 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 4B1B7BD16B for ; Tue, 4 Oct 2022 22:29:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E77D460AD5; Wed, 5 Oct 2022 00:29:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664922555; bh=vWH2LUYILonTvkpw4vveH6IDgHoiXjjT/zYq6vV3Q94=; 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=Vw0wIvkZg6svyzRFz5VrV8Ves0MTxy4aa9D4a+A/Y0GvVTM4tYiG3iA2XbXGh4A26 N9/fj5p7HsQW9AfVKg/v39FQy7xknuENRR99IxnXKhd6DUTKIdBCSGa5SLhyxDaT+8 H3/pNFoBDAJnwDuWS64S8lqrNMwGHuFEMasXRoRSSgK/e68fx0n7l2J1Ijw7uMYIBb Vwl9AhLtRN95xURzUUWXWy+UQVdcuPCx1nAJTP+KPJ2GkxbQd7BXxCVCM+ZqfBUGCK SlX+0/7W+Pp/FuePUH/Co97mNcRfSlRcOlaRpVD45bjZmOZjmj77P6LKyLinQBBl6m mvUnaT4ZoQ3lg== 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 AC5B960AC6 for ; Wed, 5 Oct 2022 00:29:13 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="kBFiX4V7"; 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 2755AFA0; Wed, 5 Oct 2022 00:29:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664922553; bh=vWH2LUYILonTvkpw4vveH6IDgHoiXjjT/zYq6vV3Q94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kBFiX4V71tk4LyFntzrK9fdPHbTx4lNHQ5ZaG++rnQzIpgKxKCROPM802BsgnQjhv WpSoPjZxoVihnymmx4KmBtSKfN+qmI7v4tw7JNeoDPDwHgoJ1qrbYzD0uTmXZIx3jU fcyQnI7wyHRysnOLMz3Wzsxw1FbVLZyboTmCvpZk= To: libcamera-devel@lists.libcamera.org Date: Wed, 5 Oct 2022 01:29:03 +0300 Message-Id: <20221004222903.6393-5-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 4/4] libcamera: v4l2_videodevice: Warn if bytesused == 0 when queuing output 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" V4L2 has deprecated queuing output buffers with bytesused set to 0. Warn if the caller attempts to do so. Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain --- src/libcamera/v4l2_videodevice.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 4d846f6be7fa..e30858c9fa02 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -1623,6 +1623,11 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer) if (V4L2_TYPE_IS_OUTPUT(buf.type)) { const FrameMetadata &metadata = buffer->metadata(); + for (const auto &plane : metadata.planes()) { + if (!plane.bytesused) + LOG(V4L2, Warning) << "byteused == 0 is deprecated"; + } + if (numV4l2Planes != planes.size()) { /* * If we have a multi-planar buffer with a V4L2