From: Hans de Goede <johannes.goede@oss.qualcomm.com>
To: Loic Poulain <loic.poulain@oss.qualcomm.com>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Kees Cook <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Bryan O'Donoghue <bod@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
devicetree@vger.kernel.org, laurent.pinchart@ideasonboard.com,
kieran.bingham@ideasonboard.com
Subject: Re: [PATCH v3 13/15] media: qcom: camss: Add CAMSS Offline Processing Engine driver
Date: Wed, 20 May 2026 17:39:44 +0200 [thread overview]
Message-ID: <038fc58a-7233-49b4-822b-a6d99abf2382@oss.qualcomm.com> (raw)
In-Reply-To: <3f75dd6a-96d8-4feb-b44c-39c8f5d3492b@oss.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]
Hi All,
On 20-May-26 17:32, johannes.goede@oss.qualcomm.com wrote:
> 4. The v3 driver limits supported capture formats for the ope_disp_output
> node (ope_enum_fmt_vid_cap()) to those matching ctx->proc_mbus_code, but
> this not how this supposed to work. For media-controller centric
> drivers, userspace is supposed to be able to enumerate all supported output
> formats, as well as output formats for a specific mbus-code.
>
> This is controlled by the v4l2_fmtdesc.mbus_code field, if this is 0
> then all formats should be returned and if it is set then only formats
> which can be outputted for that mbus-code should be returned.
>
> No active driver state like ctx->proc_mbus_code should be queried,
> setting a compatible mbus code on the sink pad which is the source
> for the /dev/video# capture node is userspace's responsibility.
>
> Also see:
> https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/vidioc-enum-fmt.html
> "Regardless of the value of the mbus_code field, the enumerated image
> formats shall not depend on the active configuration of the video
> device or device pipeline."
FYI attached is a patch fixing this, feel free to squash into the next version.
Regards,
Hans
[-- Attachment #2: 0001-media-qcom-camss-OPE-Fix-ope_enum_fmt_vid_cap.patch --]
[-- Type: text/x-patch, Size: 2301 bytes --]
From a133927c28ed24dbd5fec0b48de8718e67a0ada2 Mon Sep 17 00:00:00 2001
From: Hans de Goede <johannes.goede@oss.qualcomm.com>
Date: Tue, 19 May 2026 21:49:07 +0200
Subject: [PATCH 1/2] media: qcom: camss: OPE: Fix ope_enum_fmt_vid_cap()
The v3 driver limits supported capture formats for the ope_disp_output
node (ope_enum_fmt_vid_cap()) to those matching ctx->proc_mbus_code, but
this not how this supposed to work. For media-controller centric
drivers, userspace is supposed to be able to enumerate all supported output
formats, as well as output formats for a specific mbus-code.
This is controlled by the v4l2_fmtdesc.mbus_code field, if this is 0
then all formats should be returned and if it is set then only formats
which can be outputted for that mbus-code should be returned.
No active driver state like ctx->proc_mbus_code should be queried,
setting a compatible mbus code on the sink pad which is the source
for the /dev/video# capture node is userspace's responsibility.
Also see:
https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/vidioc-enum-fmt.html
"Regardless of the value of the mbus_code field, the enumerated image
formats shall not depend on the active configuration of the video
device or device pipeline."
Note as for the source-pad feeding into the sink-pad lining up fmt /
mbus-code wise, this is also userspace's responsibility and should be
checked by calling media_pipeline_start() at stream-on time.
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
---
drivers/media/platform/qcom/camss/camss-isp-ope.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/qcom/camss/camss-isp-ope.c b/drivers/media/platform/qcom/camss/camss-isp-ope.c
index 1febe3e7417f..495d4b0b101f 100644
--- a/drivers/media/platform/qcom/camss/camss-isp-ope.c
+++ b/drivers/media/platform/qcom/camss/camss-isp-ope.c
@@ -1800,7 +1800,7 @@ static int ope_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtde
unsigned int i, n = 0;
for (i = 0; i < ARRAY_SIZE(ope_output_fmts); i++) {
- if (ope_output_fmts[i].mbus_code != ctx->proc_mbus_code)
+ if (f->mbus_code && ope_output_fmts[i].mbus_code != f->mbus_code)
continue;
if (n++ == f->index) {
f->pixelformat = ope_output_fmts[i].fourcc;
--
2.54.0
next prev parent reply other threads:[~2026-05-20 15:39 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 22:49 [PATCH v3 00/15] media: qcom: camss: CAMSS Offline Processing Engine support Loic Poulain
2026-05-07 22:49 ` [PATCH v3 01/15] media: qcom: camss: Add PM clock support and integrate with runtime PM Loic Poulain
2026-05-07 22:49 ` [PATCH v3 02/15] media: qcom: camss: Add PM clock definitions for QCM2290 Loic Poulain
2026-05-07 22:49 ` [PATCH v3 03/15] media: qcom: camss: Drop top_ahb/axi from QCM2290 subdevice clocks Loic Poulain
2026-05-07 22:49 ` [PATCH v3 04/15] media: qcom: camss: Add camss-isp-bufq helper Loic Poulain
2026-05-08 9:57 ` Bryan O'Donoghue
2026-05-09 14:30 ` Loic Poulain
2026-05-07 22:49 ` [PATCH v3 05/15] media: qcom: camss: Add camss-isp-sched helper Loic Poulain
2026-05-08 10:05 ` Bryan O'Donoghue
2026-05-09 14:47 ` Loic Poulain
2026-05-07 22:49 ` [PATCH v3 06/15] media: qcom: camss: Add camss-isp-pipeline helper Loic Poulain
2026-05-07 22:49 ` [PATCH v3 07/15] media: qcom: camss: Add V4L2 meta format for CAMSS ISP parameters Loic Poulain
2026-05-07 22:49 ` [PATCH v3 08/15] media: qcom: camss: Add camss-isp-params helper Loic Poulain
2026-05-07 22:49 ` [PATCH v3 09/15] dt-bindings: media: qcom: Add CAMSS Offline Processing Engine (OPE) Loic Poulain
2026-05-07 22:49 ` [PATCH v3 10/15] dt-bindings: media: qcom,qcm2290-camss: Add OPE ISP subnode Loic Poulain
2026-05-13 22:51 ` Rob Herring
2026-05-07 22:49 ` [PATCH v3 11/15] media: qcom: camss: Populate CAMSS child devices via DT Loic Poulain
2026-05-07 22:49 ` [PATCH v3 12/15] media: uapi: Add CAMSS ISP configuration definition Loic Poulain
2026-05-08 9:19 ` Bryan O'Donoghue
2026-05-09 14:06 ` Loic Poulain
2026-05-07 22:49 ` [PATCH v3 13/15] media: qcom: camss: Add CAMSS Offline Processing Engine driver Loic Poulain
2026-05-20 15:32 ` johannes.goede
2026-05-20 15:35 ` Hans de Goede
2026-05-20 15:39 ` Hans de Goede [this message]
2026-05-07 22:49 ` [PATCH v3 14/15] arm64: dts: qcom: agatti: Assigned clock rate for CAMSS AXI Loic Poulain
2026-06-30 12:56 ` Konrad Dybcio
2026-06-30 12:57 ` Konrad Dybcio
2026-05-07 22:49 ` [PATCH v3 15/15] arm64: dts: qcom: agatti: Add OPE node Loic Poulain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=038fc58a-7233-49b4-822b-a6d99abf2382@oss.qualcomm.com \
--to=johannes.goede@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=bod@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gustavoars@kernel.org \
--cc=kees@kernel.org \
--cc=kieran.bingham@ideasonboard.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=mchehab@kernel.org \
--cc=robh@kernel.org \
--cc=vladimir.zapolskiy@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®