From patchwork Mon Feb 6 04:33:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Li X-Patchwork-Id: 52984 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2050271wrn; Sun, 5 Feb 2023 20:38:57 -0800 (PST) X-Google-Smtp-Source: AK7set9mFQ8OMaUzkCX25dXjwLT+YlKIBerk3tmpmK8Xr6XnGTH9/afHHcFaSOGQnoyOipHGpRPS X-Received: by 2002:a05:6402:43ca:b0:4a3:43c1:8438 with SMTP id p10-20020a05640243ca00b004a343c18438mr12307956edc.12.1675658337289; Sun, 05 Feb 2023 20:38:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675658337; cv=none; d=google.com; s=arc-20160816; b=kWdEWxkwjOE/IL9Rfr4ZBv1tgvID7ev2gN3eI3/AmXNBvDCqnTlnr6XdA8KF/axpf1 oVFw4uFuit119frxv3LtKsf2hJ1PlUsrz0zfdRLP65Yf+e3H+F/eMpyC7PBabr79/SVC MPxPQDl6hWTt9WYUjLoMLIImqMtpzBRaFtGbKh1snZTFvnMqH7JM3XZJkZ0alzms9jwe pc6dxIzqgCq065w0ZlqqL+rS9t8cfBvoD14I8tWna3RRqNgdzcFncwMVbY+p+ygHU4Ha fKXzt/6XVyXApZ41w24SjuVgnwuLbOa91/JiamZ3US8mVaVjKrEJMHU4e8/gajEuApp7 d3AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=dJNlVZQ0ZZlcfi+0K/AI1F0Ul5gs34g2hoQXjBfPCYc=; b=RXWtbtJeYP0wYXzR4FjZbOZC7sA6gAw9FmEtzP3kgfl6O/k8sL8oGGhkB6Z4hmj58K eBZA3mPyAOFTbYzbcT3Fwv7nh588JX0XI6Ef4CNffdxGzUq5GgC/qX8Yrx/ALrkiqroQ 3zE4XyUVWeFjxkakpuDnfkgH3L5PXrMqWQiLtW3x7OWX2aF4hsLS6iLSPUSNzDT5SPpj pRrwpop9jjLnpwGBKR3Z+FRWcACeec4GiTMlw44A2YVBAkl6hQ0lfNuikoVz2/JlYZzr A6Vr/Xp67A/ukZXH6LKFVPQszxm7QVhoOl5lQq5R2AonuLPscvBqW86be5UCl0b2H2MU rfyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g16-20020a056402429000b004a5912d5715si11295295edc.23.2023.02.05.20.38.34; Sun, 05 Feb 2023 20:38:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229707AbjBFEf3 (ORCPT + 99 others); Sun, 5 Feb 2023 23:35:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbjBFEfW (ORCPT ); Sun, 5 Feb 2023 23:35:22 -0500 Received: from kozue.soulik.info (kozue.soulik.info [IPv6:2001:19f0:7000:8404:5054:ff:fe75:428f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B1D31A499; Sun, 5 Feb 2023 20:34:59 -0800 (PST) Received: from misaki.sumomo.pri (unknown [192.168.0.134]) by kozue.soulik.info (Postfix) with ESMTPA id E02E7101CCC; Mon, 6 Feb 2023 13:34:49 +0900 (JST) From: ayaka To: linux-media@vger.kernel.org Cc: randy.li@synaptics.com, Brian.Starkey@arm.com, boris.brezillon@collabora.com, frkoenig@chromium.org, hans.verkuil@cisco.com, hiroh@chromium.org, hverkuil@xs4all.nl, kernel@collabora.com, laurent.pinchart@ideasonboard.com, linux-kernel@vger.kernel.org, mchehab@kernel.org, narmstrong@baylibre.com, nicolas@ndufresne.ca, sakari.ailus@iki.fi, stanimir.varbanov@linaro.org, tfiga@chromium.org, Helen Koike Subject: [PATCH v7 7/9] media: vimc: use vb2_ioctls_ext_{d}qbuf hooks Date: Mon, 6 Feb 2023 12:33:06 +0800 Message-Id: <20230206043308.28365-8-ayaka@soulik.info> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206043308.28365-1-ayaka@soulik.info> References: <20230206043308.28365-1-ayaka@soulik.info> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757055116553201396?= X-GMAIL-MSGID: =?utf-8?q?1757055116553201396?= From: Helen Koike Add vb2 ext hooks and call vb2_set_pixelformat(). This allows more flexibility with buffer handling. Signed-off-by: Helen Koike --- Changes in v7: - Refresh and rebase Changes in v6: - New patch to exemplify how drivers would easily support features from Ext Buf --- drivers/media/test-drivers/vimc/vimc-capture.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/test-drivers/vimc/vimc-capture.c b/drivers/media/test-drivers/vimc/vimc-capture.c index aa944270e716..246d90d1f5ae 100644 --- a/drivers/media/test-drivers/vimc/vimc-capture.c +++ b/drivers/media/test-drivers/vimc/vimc-capture.c @@ -218,6 +218,8 @@ static const struct v4l2_ioctl_ops vimc_capture_ioctl_ops = { .vidioc_querybuf = vb2_ioctl_querybuf, .vidioc_qbuf = vb2_ioctl_qbuf, .vidioc_dqbuf = vb2_ioctl_dqbuf, + .vidioc_ext_qbuf = vb2_ioctl_ext_qbuf, + .vidioc_ext_dqbuf = vb2_ioctl_ext_dqbuf, .vidioc_expbuf = vb2_ioctl_expbuf, .vidioc_streamon = vb2_ioctl_streamon, .vidioc_streamoff = vb2_ioctl_streamoff, @@ -389,6 +391,8 @@ static void *vimc_capture_process_frame(struct vimc_ent_device *ved, /* Set it as ready */ vb2_set_plane_payload(&vimc_buf->vb2.vb2_buf, 0, vcapture->format.sizeimage); + vb2_set_pixelformat(&vimc_buf->vb2.vb2_buf, + vcapture->format.pixelformat); vb2_buffer_done(&vimc_buf->vb2.vb2_buf, VB2_BUF_STATE_DONE); return NULL; }