From patchwork Mon Feb 6 04:33:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Li X-Patchwork-Id: 52982 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2049939wrn; Sun, 5 Feb 2023 20:37:38 -0800 (PST) X-Google-Smtp-Source: AK7set/PSL8HL8W00tW8BW4M6K8Xdn7nYRa3OAowSlDEIEn/Jz+uc318Fn11UQpIFF8bQ7VB+HbH X-Received: by 2002:a50:aadc:0:b0:4aa:a767:dc2d with SMTP id r28-20020a50aadc000000b004aaa767dc2dmr5727964edc.26.1675658258417; Sun, 05 Feb 2023 20:37:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675658258; cv=none; d=google.com; s=arc-20160816; b=li7uXxp+cwyPJuD/MvyNM8eh/6hSC84hSpbJrz1KQlPhlmq2pLmwcx+bC3oDmplulF 6k3tdkr2oBZVDnftoiN4u876eSzVUVY3M1brILSEuyWaukfXkSjxn3XIez9rvS6fucfO ro1KsJfKZjbvSgXZu2vVWKpLN65GmRupWMrbYqhH36wou1qLEAgbCI07Kgy25Tp13DW5 7NtawFH5l3ptIPTxcreAB17wi5voFPU4e612iCQ6Ai796EoYY8f01IGX+HjxJI8IHb5O K6SNMm/wj+SDgcvzACwGnLk7SouFE1OBZ1BI1J9De0pqWbDNvuAzhT9BOcziGVGhVfkG Phuw== 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=NlLYCpQvtIyM3It0L+B8cZUtNSfeE+aZsNPzWfqqiX4=; b=piMe/CUACXAjS+TnX6zlTxKKlzhWFZRRQdBmQcK6uywedk+W7suPEmjV0tRpvU21WX VTGsCFE4AkAMzcVEkULM1wU58+n4Ms9RpuCxNE4WSU+ZEA8OQZX/tmEU0iSXX3mfpm+m 7CVAAauRI7cUw9AWBaRFg3UUjKK2aR/+HtEjr+EBTP51ZbT3kAZVfm0UJaZt9mGK92yv o6kI550W8r+zpELQMwT2Ms9uszUPu0NgcsiCbh3B8a72Ls82dNC5lNKfzvpk4//eZ6bw RftWSahXqu/UVKaKOTDo07rmfx7VbhTPlKbE35dUsmzTBzlcHAH4PMWTkFsF0S918Klb XGCg== 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 c16-20020a17090620d000b008893db9590fsi12746742ejc.856.2023.02.05.20.37.15; Sun, 05 Feb 2023 20:37:38 -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 S229695AbjBFEf0 (ORCPT + 99 others); Sun, 5 Feb 2023 23:35:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbjBFEfR (ORCPT ); Sun, 5 Feb 2023 23:35:17 -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 BA40519F29; Sun, 5 Feb 2023 20:34:52 -0800 (PST) Received: from misaki.sumomo.pri (unknown [192.168.0.134]) by kozue.soulik.info (Postfix) with ESMTPA id 49149100DAB; Mon, 6 Feb 2023 13:34:31 +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 6/9] media: vivid: use vb2_ioctls_ext_{d}qbuf hooks Date: Mon, 6 Feb 2023 12:33:05 +0800 Message-Id: <20230206043308.28365-7-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?1757055033770246283?= X-GMAIL-MSGID: =?utf-8?q?1757055033770246283?= 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 v6: - New patch to exemplify how drivers would easily support features from Ext Buf --- drivers/media/test-drivers/vivid/vivid-core.c | 2 ++ drivers/media/test-drivers/vivid/vivid-vid-cap.c | 1 + drivers/media/test-drivers/vivid/vivid-vid-out.c | 1 + 3 files changed, 4 insertions(+) diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c index d4ed55aef1bb..f033c9c4e9aa 100644 --- a/drivers/media/test-drivers/vivid/vivid-core.c +++ b/drivers/media/test-drivers/vivid/vivid-core.c @@ -728,6 +728,8 @@ static const struct v4l2_ioctl_ops vivid_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, diff --git a/drivers/media/test-drivers/vivid/vivid-vid-cap.c b/drivers/media/test-drivers/vivid/vivid-vid-cap.c index 3e3a94a2e3d6..bbe0fc2a3627 100644 --- a/drivers/media/test-drivers/vivid/vivid-vid-cap.c +++ b/drivers/media/test-drivers/vivid/vivid-vid-cap.c @@ -170,6 +170,7 @@ static int vid_cap_buf_prepare(struct vb2_buffer *vb) } vb2_set_plane_payload(vb, p, size); + vb2_set_pixelformat(vb, dev->fmt_cap->fourcc); vb->planes[p].data_offset = dev->fmt_cap->data_offset[p]; } diff --git a/drivers/media/test-drivers/vivid/vivid-vid-out.c b/drivers/media/test-drivers/vivid/vivid-vid-out.c index 936ba93c00cc..5f224f13aa99 100644 --- a/drivers/media/test-drivers/vivid/vivid-vid-out.c +++ b/drivers/media/test-drivers/vivid/vivid-vid-out.c @@ -137,6 +137,7 @@ static int vid_out_buf_prepare(struct vb2_buffer *vb) return -EINVAL; } } + vb2_set_pixelformat(vb, dev->fmt_out->fourcc); return 0; }