From patchwork Tue Apr 5 20:44:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne X-Patchwork-Id: 12802065 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09AD7C43219 for ; Tue, 5 Apr 2022 23:12:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573986AbiDEWyA (ORCPT ); Tue, 5 Apr 2022 18:54:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443090AbiDEWUI (ORCPT ); Tue, 5 Apr 2022 18:20:08 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8324F6A019; Tue, 5 Apr 2022 13:44:46 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nicolas) with ESMTPSA id 40C121F44815 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1649191485; bh=BQPoxOAZCWnxNCOeZo2D/Nd5xmmLaOzP4aXydtQmwEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J5XvJnJIzIJfIFfb3ak7r7VPBkRqlaoIV/jCoXCH50D/P7pqPnPXqyM39DEQ9yG3L SSDRtkJ18illFj2TYXHW+fKdI7vkQWqVoRxsOet2NGbFrAZ6YTAVrj4KQLlILTDppO 1B+iGxU0krR3w+KndsAJFdCXeKtZjLIMGx3STHhwA8VMZWfdYnUPtmlAV+NNt4xHwl p2cWanOAbE1nesWo4jdAKR6z0IUVt/9B6MEz7ia/t/CJnMgMkMY3xC3LHke3EKH1OW FjEzbT0YrpgnoJv8nyhF+2SNFbQw27NInq8YsIQFatMbKeMdB2jlnAbLniTyzidHch Sp8W2TVEKTvQg== From: Nicolas Dufresne To: Tomasz Figa , Marek Szyprowski , Mauro Carvalho Chehab Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, Sebastian Fricke , Ezequiel Garcia , linux-media@vger.kernel.org Subject: [PATCH v3 03/24] media: videobuf2-v4l2: Warn on holding buffers without support Date: Tue, 5 Apr 2022 16:44:04 -0400 Message-Id: <20220405204426.259074-4-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220405204426.259074-1-nicolas.dufresne@collabora.com> References: <20220405204426.259074-1-nicolas.dufresne@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Sebastian Fricke Using V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF flag without specifying the subsystem flag VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF, results in silently ignoring it. Warn the user via a debug print when the flag is requested but ignored by the videobuf2 framework. Signed-off-by: Sebastian Fricke Signed-off-by: Nicolas Dufresne Reviewed-by: Ezequiel Garcia --- drivers/media/common/videobuf2/videobuf2-v4l2.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c index 6edf4508c636..812c8d1962e0 100644 --- a/drivers/media/common/videobuf2/videobuf2-v4l2.c +++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c @@ -329,8 +329,13 @@ static int vb2_fill_vb2_v4l2_buffer(struct vb2_buffer *vb, struct v4l2_buffer *b */ vbuf->flags &= ~V4L2_BUF_FLAG_TIMECODE; vbuf->field = b->field; - if (!(q->subsystem_flags & VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF)) + if (!(q->subsystem_flags & VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF)) { + if (vbuf->flags & V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF) + dprintk(q, 1, + "Request holding buffer (%d), unsupported on output queue\n", + b->index); vbuf->flags &= ~V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF; + } } else { /* Zero any output buffer flags as this is a capture buffer */ vbuf->flags &= ~V4L2_BUFFER_OUT_FLAGS;